xunge/DecIR huggingface dataset:
/* Variables and functions */
int omp_get_num_threads();
int omp_get_thread_num();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int nthreads, tid;
#pragma omp parallel private(tid)
  {
    tid = omp_get_thread_num();
    printf("Hello world from thread = %d\n", tid);
    if (tid == 0) {
      nthreads = omp_get_num_threads();
      printf("number of threads = %d\n", nthreads);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
cmpl   $0x0,-0xc(%rbp)
jne    117b <main+0x4b>
mov    $0x0,%al
call   1050 <omp_get_num_threads@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
mov    %eax,%ebx
lea    0xebf(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
test   %ebx,%ebx
jne    1161 <main+0x31>
xor    %eax,%eax
call   1050 <omp_get_num_threads@plt>
lea    0xec4(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Hello world from thread = %d\0A\00"
@.str.1 = [24 x i8] c"number of threads = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @omp_get_thread_num()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %0
%10 = call i32 (...) @omp_get_num_threads()
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %9, %0
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@.str = [30 x i8] c"Hello world from thread = %d\0A\00"
@.str.1 = [24 x i8] c"number of threads = %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @omp_get_thread_num()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = tail call i32 (...) @omp_get_num_threads()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %5)
br label %7
7: ; preds = %4, %0
ret i32 0
}
unsigned long long ff(unsigned long long a) {
  return (a & 0xfff0000000000ull) >> 40;
}


x86 assembly (clang, -O0):
<ff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movabs $0xfff0000000000,%rax
and    -0x8(%rbp),%rax
shr    $0x28,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ff>:
mov    %rdi,%rax
shr    $0x28,%rax
and    $0xfff,%eax
ret

LLVM IR (-O0):
define i64 @ff(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 4502500115742720
%5 = lshr i64 %4, 40
ret i64 %5
}

LLVM IR (-O2):
define i64 @ff(i64 %0) {
%2 = lshr i64 %0, 40
%3 = and i64 %2, 4095
ret i64 %3
}
void count_lz_v4si(unsigned *__restrict a, int *__restrict b) {
  int i;
  for (i = 0; i < 4; i++)
    b[i] = __builtin_clz(a[i]);
}


x86 assembly (clang, -O0):
<count_lz_v4si>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    1147 <count_lz_v4si+0x47>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
bsr    %eax,%edx
xor    $0x1f,%edx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <count_lz_v4si+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_lz_v4si>:
bsr    (%rdi),%eax
xor    $0x1f,%eax
mov    %eax,(%rsi)
bsr    0x4(%rdi),%eax
xor    $0x1f,%eax
mov    %eax,0x4(%rsi)
bsr    0x8(%rdi),%eax
xor    $0x1f,%eax
mov    %eax,0x8(%rsi)
bsr    0xc(%rdi),%eax
xor    $0x1f,%eax
mov    %eax,0xc(%rsi)
ret

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

LLVM IR (-O2):
define void @count_lz_v4si(i32* noalias nocapture %0, i32* noalias nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = tail call i32 @llvm.ctlz.i32(i32 %3, i1 true)
store i32 %4, i32* %1
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = load i32, i32* %5
%7 = tail call i32 @llvm.ctlz.i32(i32 %6, i1 true)
%8 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %7, i32* %8
%9 = getelementptr inbounds i32, i32* %0, i64 2
%10 = load i32, i32* %9
%11 = tail call i32 @llvm.ctlz.i32(i32 %10, i1 true)
%12 = getelementptr inbounds i32, i32* %1, i64 2
store i32 %11, i32* %12
%13 = getelementptr inbounds i32, i32* %0, i64 3
%14 = load i32, i32* %13
%15 = tail call i32 @llvm.ctlz.i32(i32 %14, i1 true)
%16 = getelementptr inbounds i32, i32* %1, i64 3
store i32 %15, i32* %16
ret void
}
int tolower(int ch) {
  if ((unsigned int)(ch - 'A') < 26u)
    ch += 'a' - 'A';
  return ch;
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x41,%eax
cmp    $0x1a,%eax
jae    111f <tolower+0x1f>
mov    -0x4(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @tolower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 65
%5 = icmp ult i32 %4, 26
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 32
store i32 %8, i32* %2
br label %9
9: ; preds = %6, %1
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = add nsw i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
void _marshall_put16(void *pBuf, unsigned short iVal) {
  ((char *)(pBuf))[0] = ((char *)(&iVal))[1],
         ((char *)(pBuf))[1] = ((char *)(&iVal))[0];
}


x86 assembly (clang, -O0):
<_marshall_put16>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xa(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_marshall_put16>:
rol    $0x8,%si
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @_marshall_put16(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = bitcast i16* %4 to i8*
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %6
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 %7, i8* %9
%10 = bitcast i16* %4 to i8*
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 1
store i8 %12, i8* %14
ret void
}

LLVM IR (-O2):
define void @_marshall_put16(i8* nocapture writeonly %0, i16 zeroext %1) {
%3 = trunc i16 %1 to i8
%4 = lshr i16 %1, 8
%5 = trunc i16 %4 to i8
store i8 %5, i8* %0
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %3, i8* %6
ret void
}
int PeekAtLastError(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @PeekAtLastError() {
ret i32 0
}
/* Variables and functions */
double vector_norm(double *);
void normalize(double *v) {
  double norm;
  norm = vector_norm(v);
  v[0] = v[0] / norm;
  v[1] = v[1] / norm;
  v[2] = v[2] / norm;
}


x86 assembly (clang, -O0):
<normalize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <vector_norm@plt>
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
divsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
divsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
divsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<normalize>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vector_norm@plt>
movupd (%rbx),%xmm1
movapd %xmm0,%xmm2
unpcklpd %xmm0,%xmm2
divpd  %xmm2,%xmm1
movupd %xmm1,(%rbx)
movsd  0x10(%rbx),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @normalize(double* %0) {
%2 = alloca double*
%3 = alloca double
store double* %0, double** %2
%4 = load double*, double** %2
%5 = call double @vector_norm(double* %4)
store double %5, double* %3
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double, double* %3
%10 = fdiv double %8, %9
%11 = load double*, double** %2
%12 = getelementptr inbounds double, double* %11, i64 0
store double %10, double* %12
%13 = load double*, double** %2
%14 = getelementptr inbounds double, double* %13, i64 1
%15 = load double, double* %14
%16 = load double, double* %3
%17 = fdiv double %15, %16
%18 = load double*, double** %2
%19 = getelementptr inbounds double, double* %18, i64 1
store double %17, double* %19
%20 = load double*, double** %2
%21 = getelementptr inbounds double, double* %20, i64 2
%22 = load double, double* %21
%23 = load double, double* %3
%24 = fdiv double %22, %23
%25 = load double*, double** %2
%26 = getelementptr inbounds double, double* %25, i64 2
store double %24, double* %26
ret void
}

LLVM IR (-O2):
define void @normalize(double* %0) {
%2 = tail call double @vector_norm(double* %0)
%3 = bitcast double* %0 to <2 x double>*
%4 = load <2 x double>, <2 x double>* %3
%5 = insertelement <2 x double> poison, double %2, i64 0
%6 = shufflevector <2 x double> %5, <2 x double> poison, <2 x i32> zeroinitializer
%7 = fdiv <2 x double> %4, %6
%8 = bitcast double* %0 to <2 x double>*
store <2 x double> %7, <2 x double>* %8
%9 = getelementptr inbounds double, double* %0, i64 2
%10 = load double, double* %9
%11 = fdiv double %10, %2
store double %11, double* %9
ret void
}
unsigned int hash(char *s) {
  unsigned int h = 0;
  for (; *s; s++)
    h = *s + h * 31;
  return h % 501;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113d <hash+0x3d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
imul   $0x1f,-0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <hash+0xf>
mov    -0xc(%rbp),%eax
mov    $0x1f5,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     113f <hash+0x3f>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
mov    %eax,%edx
shl    $0x5,%edx
sub    %eax,%edx
mov    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
mov    %eax,%ecx
imul   $0x20b3dd41,%rcx,%rcx
shr    $0x26,%rcx
imul   $0x1f5,%ecx,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = mul i32 %6, 31
%10 = add i32 %9, %8
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = urem i32 %10, 501
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
/* Type definitions */
typedef size_t uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
size_t quicly_encodev_capacity(int /*<<< orphan*/);
size_t quicly_new_connection_id_frame_capacity(uint64_t sequence,
                                               uint64_t retire_prior_to,
                                               uint8_t cid_len) {
  size_t frame_type_len = 1;
  size_t length_len = 1;
  return frame_type_len + quicly_encodev_capacity(sequence) +
         quicly_encodev_capacity(retire_prior_to) + length_len + cid_len + 16;
}


x86 assembly (clang, -O0):
<quicly_new_connection_id_frame_capacity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
movq   $0x1,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <quicly_encodev_capacity@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <quicly_encodev_capacity@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
add    %rcx,%rax
add    -0x20(%rbp),%rax
add    -0x10(%rbp),%rax
add    $0x10,%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicly_new_connection_id_frame_capacity>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
call   1030 <quicly_encodev_capacity@plt>
mov    %rax,%rbx
mov    %ebp,%edi
call   1030 <quicly_encodev_capacity@plt>
add    %r14,%rbx
add    %rbx,%rax
add    $0x12,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i64 @quicly_new_connection_id_frame_capacity(i32 %0, i32 %1, i64 %2) {
%4 = tail call i64 @quicly_encodev_capacity(i32 %0)
%5 = tail call i64 @quicly_encodev_capacity(i32 %1)
%6 = add i64 %2, 18
%7 = add i64 %6, %4
%8 = add i64 %7, %5
ret i64 %8
}
/* Variables and functions */
scalar_t__ sched_yield();
int ti_yield() { return (sched_yield() ? 0 : 1); }


x86 assembly (clang, -O0):
<ti_yield>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <sched_yield@plt>
mov    %rax,%rdx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ti_yield() {
%1 = call i64 (...) @sched_yield()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i32 0, i32 1
ret i32 %4
}

LLVM IR (-O2):
define i32 @ti_yield() {
%1 = tail call i64 (...) @sched_yield()
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int InitWindow(int, char **);
int main(int argc, char *argv[]) { return InitWindow(argc, argv); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <InitWindow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <InitWindow@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @InitWindow(i32 %0, i8** %1)
ret i32 %3
}
void destroyTree() {}


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

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

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

LLVM IR (-O2):
define void @destroyTree() {
ret void
}
/* Variables and functions */
int unix_is_interactive();
int plat_is_interactive(void) { return (unix_is_interactive()); }


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

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

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

LLVM IR (-O2):
define i32 @plat_is_interactive() {
%1 = tail call i32 (...) @unix_is_interactive()
ret i32 %1
}
void *test_anti_range_53(int n) {
  extern void *alloc_anti_range_53(int) __attribute__((alloc_size(1)));
  if (-3 <= n && n <= 12)
    n = -3 - 1;
  return alloc_anti_range_53(n);
}


x86 assembly (clang, -O0):
<test_anti_range_53>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xfffffffd,%eax
cmp    -0x4(%rbp),%eax
jg     113a <test_anti_range_53+0x2a>
cmpl   $0xc,-0x4(%rbp)
jg     113a <test_anti_range_53+0x2a>
movl   $0xfffffffc,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <alloc_anti_range_53@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_53>:
lea    0x3(%rdi),%eax
cmp    $0x10,%eax
mov    $0xfffffffc,%eax
cmovb  %eax,%edi
jmp    1030 <alloc_anti_range_53@plt>

LLVM IR (-O0):
define i8* @test_anti_range_53(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 -3, %3
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 12
br i1 %7, label %8, label %9
8: ; preds = %5
store i32 -4, i32* %2
br label %9
9: ; preds = %8, %5, %1
%10 = load i32, i32* %2
%11 = call i8* @alloc_anti_range_53(i32 %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @test_anti_range_53(i32 %0) {
%2 = add i32 %0, 3
%3 = icmp ult i32 %2, 16
%4 = select i1 %3, i32 -4, i32 %0
%5 = tail call i8* @alloc_anti_range_53(i32 %4)
ret i8* %5
}
int f(void) {
  int went = 0;
  goto label1;
  static int z;
label1:
  z++;
label2:;
  static int y;
  y++;
  if (!went) {
    went = 1;
    goto label2;
  }
  return z + y;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0x2f13(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f0a(%rip)
mov    0x2f08(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2eff(%rip)
cmpl   $0x0,-0x4(%rbp)
jne    113f <f+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    111a <f+0x1a>
mov    0x2edf(%rip),%eax
add    0x2edd(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    0x2f1e(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f15(%rip)
mov    0x2f13(%rip),%ecx
lea    0x2(%rcx),%edx
mov    %edx,0x2f0a(%rip)
add    %ecx,%eax
add    $0x3,%eax
ret

LLVM IR (-O0):
@f.z = internal global i32 0
@f.y = internal global i32 0
define i32 @f() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0
%3 = load i32, i32* @f.z
%4 = add nsw i32 %3, 1
store i32 %4, i32* @f.z
br label %5
5: ; preds = %10, %2
%6 = load i32, i32* @f.y
%7 = add nsw i32 %6, 1
store i32 %7, i32* @f.y
%8 = load i32, i32* %1
%9 = icmp ne i32 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %5
store i32 1, i32* %1
br label %5
11: ; preds = %5
%12 = load i32, i32* @f.z
%13 = load i32, i32* @f.y
%14 = add nsw i32 %12, %13
ret i32 %14
}

LLVM IR (-O2):
@f.z = internal unnamed_addr global i32 0
@f.y = internal unnamed_addr global i32 0
define i32 @f() {
%1 = load i32, i32* @f.z
%2 = add nsw i32 %1, 1
store i32 %2, i32* @f.z
%3 = load i32, i32* @f.y
%4 = add i32 %3, 2
store i32 %4, i32* @f.y
%5 = add nsw i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int f(int *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int *p = NULL;
  int ret = 0;
  ret = f(p);
  printf("%d\n", ret);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <f@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @f(i32* null)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0xc4() {
  Assert_real((isupper(196) == 0),
              "/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_isupper.c",
              985, ("isupper should be 0 for 0xc4"));
}


x86 assembly (clang, -O0):
<t_isupper_0xc4>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc4,%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x3d9,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0xc4>:
push   %rax
mov    $0xc4,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3d9,%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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xc4\00"
define void @t_isupper_0xc4() {
%1 = call i64 @isupper(i32 196)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 985, 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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xc4\00"
define void @t_isupper_0xc4() {
%1 = tail call i64 @isupper(i32 196)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 985, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int recurse2a(int);
int recurse2b(int i) { return recurse2a(i + 1); }


x86 assembly (clang, -O0):
<recurse2b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1030 <recurse2a@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recurse2b>:
add    $0x1,%edi
jmp    1030 <recurse2a@plt>

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

LLVM IR (-O2):
define i32 @recurse2b(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = tail call i32 @recurse2a(i32 %2)
ret i32 %3
}
g(int i) {}


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

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

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

LLVM IR (-O2):
define i32 @g(i32 %0) {
ret i32 undef
}
/* Type definitions */
typedef int __v2di;

/* Variables and functions */
__v2di bar(const __v2di x, const __v2di y) { return x == y; }


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

x86 assembly (clang, -O2):
<bar>:
xor    %eax,%eax
cmp    %esi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @bar(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 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @bar(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int PAPI_epc(int, float *, float *, long long *, long long *, long long *,
             float *);
void PAPIF_EPC(int event, float *rtime, float *ptime, long long *ref,
               long long *core, long long *evt, float *epc, int *check) {
  *check = PAPI_epc(event, rtime, ptime, ref, core, evt, epc);
}


x86 assembly (clang, -O0):
<PAPIF_EPC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <PAPI_epc@plt>
mov    %eax,%ecx
mov    0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PAPIF_EPC>:
push   %rbx
sub    $0x10,%rsp
mov    0x28(%rsp),%rbx
mov    0x20(%rsp),%rax
mov    %rax,(%rsp)
call   1030 <PAPI_epc@plt>
mov    %eax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @PAPIF_EPC(i32 %0, float* %1, float* %2, i64* %3, i64* %4, i64* %5, float* %6, i32* %7) {
%9 = alloca i32
%10 = alloca float*
%11 = alloca float*
%12 = alloca i64*
%13 = alloca i64*
%14 = alloca i64*
%15 = alloca float*
%16 = alloca i32*
store i32 %0, i32* %9
store float* %1, float** %10
store float* %2, float** %11
store i64* %3, i64** %12
store i64* %4, i64** %13
store i64* %5, i64** %14
store float* %6, float** %15
store i32* %7, i32** %16
%17 = load i32, i32* %9
%18 = load float*, float** %10
%19 = load float*, float** %11
%20 = load i64*, i64** %12
%21 = load i64*, i64** %13
%22 = load i64*, i64** %14
%23 = load float*, float** %15
%24 = call i32 @PAPI_epc(i32 %17, float* %18, float* %19, i64* %20, i64* %21, i64* %22, float* %23)
%25 = load i32*, i32** %16
store i32 %24, i32* %25
ret void
}

LLVM IR (-O2):
define void @PAPIF_EPC(i32 %0, float* %1, float* %2, i64* %3, i64* %4, i64* %5, float* %6, i32* nocapture writeonly %7) {
%9 = tail call i32 @PAPI_epc(i32 %0, float* %1, float* %2, i64* %3, i64* %4, i64* %5, float* %6)
store i32 %9, i32* %7
ret void
}
void default_callback() {}


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

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

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

LLVM IR (-O2):
define void @default_callback() {
ret void
}
unsigned xrop3_50_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = T | S;
  stk2 = D | stk3;
  stk1 = S ^ stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_50_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_50_0_0>:
mov    %edi,%eax
shl    $0x8,%eax
lea    (%rdi,%rax,1),%ecx
shl    $0x8,%esi
or     %esi,%eax
or     $0xff,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_50_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %7
%24 = load i32, i32* %6
%25 = or i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %5
%27 = load i32, i32* %10
%28 = or i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %6
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
ret i32 %32
}

LLVM IR (-O2):
define i32 @xrop3_50_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = or i32 %4, %3
%6 = zext i8 %1 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %4, %7
%9 = or i32 %8, 255
%10 = xor i32 %9, %5
ret i32 %10
}
/* Variables and functions */
int strlen(char *);
int last_colon(char *p) {
  int n = strlen(p) - 1;
  while (n > 0 && p[n] != ':')
    n--;
  return n;
}


x86 assembly (clang, -O0):
<last_colon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jle    114f <last_colon+0x3f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3a,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    115f <last_colon+0x4f>
jmp    116d <last_colon+0x5d>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    112b <last_colon+0x1b>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<last_colon>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    %eax,%edx
test   %eax,%eax
mov    $0x1,%eax
cmovle %ecx,%eax
add    $0xffffffff,%eax
nopw   0x0(%rax,%rax,1)
cmp    $0x2,%edx
jl     1143 <last_colon+0x33>
add    $0xffffffffffffffff,%rdx
mov    %edx,%ecx
cmpb   $0x3a,(%rbx,%rcx,1)
jne    1130 <last_colon+0x20>
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @last_colon(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = sub nsw i32 %5, 1
store i32 %6, i32* %3
br label %7
7: ; preds = %20, %1
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %7
%11 = load i8*, i8** %2
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 58
br label %18
18: ; preds = %10, %7
%19 = phi i1 [ false, %7 ], [ %17, %10 ]
br i1 %19, label %20, label %23
20: ; preds = %18
%21 = load i32, i32* %3
%22 = add nsw i32 %21, -1
store i32 %22, i32* %3
br label %7
23: ; preds = %18
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @last_colon(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = zext i32 %2 to i64
%4 = call i32 @llvm.smin.i32(i32 %2, i32 1)
%5 = add i32 %4, -1
br label %6
6: ; preds = %11, %1
%7 = phi i64 [ %8, %11 ], [ %3, %1 ]
%8 = add nsw i64 %7, -1
%9 = trunc i64 %7 to i32
%10 = icmp sgt i32 %9, 1
br i1 %10, label %11, label %18
11: ; preds = %6
%12 = and i64 %8, 4294967295
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 58
br i1 %15, label %16, label %6
16: ; preds = %11
%17 = trunc i64 %8 to i32
br label %18
18: ; preds = %6, %16
%19 = phi i32 [ %17, %16 ], [ %5, %6 ]
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ vectortest2();
int main(int args, char **argv) {
  vectortest2();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <vectortest2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <vectortest2@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @vectortest2()
ret i32 0
}
int test_imm_13uint8_mem(unsigned char *val) {
  return ((*val) & (0x13 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_13uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0x13,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_13uint8_mem>:
testb  $0x13,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_13uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 19
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void TIM8_UP_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @TIM8_UP_IRQHandler() {
ret void
}
int style_concatenable(const unsigned char *given_char) {
  int concatenable = 0;
  switch (*given_char) {
  case ':':
  case ';':
  case ',':
  case '{':
  case '}':
    concatenable = 1;
  }
  return (concatenable);
}


x86 assembly (clang, -O0):
<style_concatenable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,-0x10(%rbp)
sub    $0x2c,%eax
je     115d <style_concatenable+0x5d>
jmp    1127 <style_concatenable+0x27>
mov    -0x10(%rbp),%eax
add    $0xffffffc6,%eax
sub    $0x2,%eax
jb     115d <style_concatenable+0x5d>
jmp    113b <style_concatenable+0x3b>
mov    -0x10(%rbp),%eax
sub    $0x7b,%eax
je     115d <style_concatenable+0x5d>
jmp    114c <style_concatenable+0x4c>
mov    -0x10(%rbp),%eax
sub    $0x7d,%eax
jne    1164 <style_concatenable+0x64>
jmp    115d <style_concatenable+0x5d>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<style_concatenable>:
movzbl (%rdi),%ecx
cmp    $0x3b,%rcx
ja     1119 <style_concatenable+0x19>
movabs $0xc00100000000000,%rax
bt     %rcx,%rax
jb     1125 <style_concatenable+0x25>
cmp    $0x7d,%cl
je     1125 <style_concatenable+0x25>
xor    %eax,%eax
cmp    $0x7b,%cl
jne    112a <style_concatenable+0x2a>
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @style_concatenable(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
switch i32 %6, label %8 [
i32 58, label %7
i32 59, label %7
i32 44, label %7
i32 123, label %7
i32 125, label %7
]
7: ; preds = %1, %1, %1, %1, %1
store i32 1, i32* %3
br label %8
8: ; preds = %7, %1
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @style_concatenable(i8* nocapture %0) {
%2 = load i8, i8* %0
switch i8 %2, label %4 [
i8 58, label %3
i8 59, label %3
i8 44, label %3
i8 123, label %3
i8 125, label %3
]
3: ; preds = %1, %1, %1, %1, %1
br label %4
4: ; preds = %3, %1
%5 = phi i32 [ 0, %1 ], [ 1, %3 ]
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/
nnb_422_downsample_r_g_b_vectors_sse2_ssse3(int /*<<< orphan*/ *,
                                            int /*<<< orphan*/ *);
extern void nnb_422_downsample_r_g_b_vectors_sse2_ssse3_sse41(__m128i *in,
                                                              __m128i *out) {
  nnb_422_downsample_r_g_b_vectors_sse2_ssse3(in, out);
}


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

x86 assembly (clang, -O2):
<nnb_422_downsample_r_g_b_vectors_sse2_ssse3_sse41>:
jmp    1030 <nnb_422_downsample_r_g_b_vectors_sse2_ssse3@plt>

LLVM IR (-O0):
define void @nnb_422_downsample_r_g_b_vectors_sse2_ssse3_sse41(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 @nnb_422_downsample_r_g_b_vectors_sse2_ssse3(i32* %5, i32* %6)
ret void
}

LLVM IR (-O2):
define void @nnb_422_downsample_r_g_b_vectors_sse2_ssse3_sse41(i32* %0, i32* %1) {
%3 = tail call i32 @nnb_422_downsample_r_g_b_vectors_sse2_ssse3(i32* %0, i32* %1)
ret void
}
/* Variables and functions */
double tic();
double toc(double t) {
  double s = tic();
  return ((((0) > (s - t)) ? (0) : (s - t)));
}


x86 assembly (clang, -O0):
<toc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <tic@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm1
subsd  -0x8(%rbp),%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    114d <toc+0x3d>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    115c <toc+0x4c>
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toc>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <tic@plt>
subsd  (%rsp),%xmm0
xorpd  %xmm1,%xmm1
maxsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @toc(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = call double (...) @tic()
store double %4, double* %3
%5 = load double, double* %3
%6 = load double, double* %2
%7 = fsub double %5, %6
%8 = fcmp ogt double 0.000000e+00, %7
br i1 %8, label %9, label %10
9: ; preds = %1
br label %14
10: ; preds = %1
%11 = load double, double* %3
%12 = load double, double* %2
%13 = fsub double %11, %12
br label %14
14: ; preds = %10, %9
%15 = phi double [ 0.000000e+00, %9 ], [ %13, %10 ]
ret double %15
}

LLVM IR (-O2):
define double @toc(double %0) {
%2 = tail call double (...) @tic()
%3 = fsub double %2, %0
%4 = fcmp olt double %3, 0.000000e+00
%5 = select i1 %4, double 0.000000e+00, double %3
ret double %5
}
/* Variables and functions */
double drand48();
double lrand48();
double mrand48();
int /*<<< orphan*/ printf(char *, double);
int main() {
  double r = drand48();
  printf("%lf\n", r * 10);
  printf("%ld\n", lrand48());
  printf("%ld\n", mrand48());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <drand48@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  0xe9d(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <lrand48@plt>
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <mrand48@plt>
lea    0xe78(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1060 <drand48@plt>
mulsd  0xeb0(%rip),%xmm0
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <lrand48@plt>
lea    0xea3(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <mrand48@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%lf\0A\00"
@.str.1 = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
%3 = call double (...) @drand48()
store double %3, double* %2
%4 = load double, double* %2
%5 = fmul double %4, 1.000000e+01
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %5)
%7 = call double (...) @lrand48()
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %7)
%9 = call double (...) @mrand48()
%10 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lf\0A\00"
@.str.1 = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = tail call double (...) @drand48()
%2 = fmul double %1, 1.000000e+01
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %2)
%4 = tail call double (...) @lrand48()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %4)
%6 = tail call double (...) @mrand48()
%7 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %6)
ret i32 0
}
/* Variables and functions */
int libisofs_md5(void **, char *, int, int /*<<< orphan*/ *,
                 int /*<<< orphan*/);
int iso_md5_compute(void *md5_context, char *data, int datalen) {
  int ret;
  ret = libisofs_md5(&md5_context, data, datalen, NULL, 0);
  if (ret <= 0)
    return 0xE830FFFB;
  return 1;
}


x86 assembly (clang, -O0):
<iso_md5_compute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%ecx
xor    %r8d,%r8d
call   1030 <libisofs_md5@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jg     1153 <iso_md5_compute+0x43>
movl   $0xe830fffb,-0x4(%rbp)
jmp    115a <iso_md5_compute+0x4a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iso_md5_compute>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <libisofs_md5@plt>
test   %eax,%eax
mov    $0xe830fffb,%ecx
mov    $0x1,%eax
cmovle %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @iso_md5_compute(i8* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%9 = load i8*, i8** %6
%10 = load i32, i32* %7
%11 = call i32 @libisofs_md5(i8** %5, i8* %9, i32 %10, i32* null, i32 0)
store i32 %11, i32* %8
%12 = load i32, i32* %8
%13 = icmp sle i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %3
store i32 -399441925, i32* %4
br label %16
15: ; preds = %3
store i32 1, i32* %4
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %4
ret i32 %17
}

LLVM IR (-O2):
define i32 @iso_md5_compute(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
store i8* %0, i8** %4
%5 = call i32 @libisofs_md5(i8** %4, i8* %1, i32 %2, i32* null, i32 0)
%6 = icmp slt i32 %5, 1
%7 = select i1 %6, i32 -399441925, i32 1
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void main() {
  FILE *fp;
  char *a;
  fp = fopen("abc.txt", "r");
  fseek(fp, 4L, SEEK_SET);
  fscanf(fp, "%s", a);
  printf("%s", a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
lea    0xeb2(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e76(%rip),%rax
mov    (%rax),%edx
mov    $0x4,%esi
call   1050 <fseek@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe85(%rip),%rsi
call   1040 <fscanf@plt>
mov    -0x10(%rbp),%rsi
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xeb5(%rip),%rdi
lea    0xeb6(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
mov    0x2e7f(%rip),%rax
mov    (%rax),%edx
mov    $0x4,%esi
mov    %rbx,%rdi
call   1050 <fseek@plt>
lea    0xe93(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <fscanf@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"abc.txt\00"
@.str.1 = [2 x i8] c"r\00"
@SEEK_SET = global i32 0
@.str.2 = [3 x i8] c"%s\00"
define void @main() {
%1 = alloca i32*
%2 = alloca i8*
%3 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = load i32, i32* @SEEK_SET
%6 = call i32 @fseek(i32* %4, i64 4, i32 %5)
%7 = load i32*, i32** %1
%8 = load i8*, i8** %2
%9 = call i32 @fscanf(i32* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %8)
%10 = load i8*, i8** %2
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"abc.txt\00"
@.str.1 = [2 x i8] c"r\00"
@SEEK_SET = global i32 0
@.str.2 = [3 x i8] c"%s\00"
define void @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = load i32, i32* @SEEK_SET
%3 = tail call i32 @fseek(i32* %1, i64 4, i32 %2)
%4 = tail call i32 @fscanf(i32* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* undef)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* undef)
ret void
}