xunge/DecIR huggingface dataset:
void RotationWord(unsigned char *pWord) {
  unsigned char temp = pWord[0];
  pWord[0] = pWord[1];
  pWord[1] = pWord[2];
  pWord[2] = pWord[3];
  pWord[3] = temp;
}


x86 assembly (clang, -O0):
<RotationWord>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RotationWord>:
mov    (%rdi),%al
mov    0x1(%rdi),%cl
mov    %cl,(%rdi)
movzwl 0x2(%rdi),%ecx
mov    %cx,0x1(%rdi)
mov    %al,0x3(%rdi)
ret

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

LLVM IR (-O2):
define void @RotationWord(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
store i8 %4, i8* %0
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
store i8 %6, i8* %3
%7 = getelementptr inbounds i8, i8* %0, i64 3
%8 = load i8, i8* %7
store i8 %8, i8* %5
store i8 %2, i8* %7
ret void
}
/* Variables and functions */
int sstrlen(char *str) {
  int c = 0;
  while (*str++ != 0)
    c++;
  return c;
}


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

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

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

LLVM IR (-O2):
define i32 @sstrlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
int comp_name(void const *, void const *);
int comp_value(void const *, void const *);
int comp_name_value(const void *a, const void *b) {
  int res;
  res = comp_name(a, b);
  return res ? res : comp_value(a, b);
}


x86 assembly (clang, -O0):
<comp_name_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <comp_name@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1155 <comp_name_value+0x35>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1165 <comp_name_value+0x45>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <comp_value@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp_name_value>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <comp_name@plt>
test   %eax,%eax
je     113b <comp_name_value+0x1b>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <comp_value@plt>

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

LLVM IR (-O2):
define i32 @comp_name_value(i8* %0, i8* %1) {
%3 = tail call i32 @comp_name(i8* %0, i8* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @comp_value(i8* %0, i8* %1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ %3, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ mulmn(float *, float const *, float *);
void ntransform(float *src, int num, const float *to) {
  int i;
  for (i = num; i > 0; i--) {
    mulmn(src, to, src);
    src += 3;
  }
}


x86 assembly (clang, -O0):
<ntransform>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jle    115e <ntransform+0x4e>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rdx
call   1030 <mulmn@plt>
mov    -0x8(%rbp),%rax
add    $0xc,%rax
mov    %rax,-0x8(%rbp)
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    1129 <ntransform+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntransform>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    114a <ntransform+0x3a>
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
add    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <mulmn@plt>
add    $0xc,%rbx
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1130 <ntransform+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @ntransform(float* %0, i32 %1, float* %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %12
5: ; preds = %3, %5
%6 = phi i32 [ %10, %5 ], [ %1, %3 ]
%7 = phi float* [ %9, %5 ], [ %0, %3 ]
%8 = tail call i32 @mulmn(float* %7, float* %2, float* %7)
%9 = getelementptr inbounds float, float* %7, i64 3
%10 = add nsw i32 %6, -1
%11 = icmp ugt i32 %6, 1
br i1 %11, label %5, label %12
12: ; preds = %5, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t bytes_to_h8(char *bytes) {
  uint8_t result = *(uint8_t *)bytes;
  return result;
}


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

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

LLVM IR (-O0):
define i32 @bytes_to_h8(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @bytes_to_h8(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
void function_with_macro_name() {}


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

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

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

LLVM IR (-O2):
define void @function_with_macro_name() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ h2o__fatal(char *);
void *malloc(size_t);
void *h2o_mem_alloc(size_t sz) {
  void *p = malloc(sz);
  if (p == NULL)
    h2o__fatal("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/lkwg82/h2o/refs/heads/master/"
               "include/h2o/memory.h"
               ":"
               "350"
               ":"
               "no memory");
  return p;
}


x86 assembly (clang, -O0):
<h2o_mem_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <h2o_mem_alloc+0x30>
lea    0xeb5(%rip),%rdi
call   1030 <h2o__fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h2o_mem_alloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <h2o_mem_alloc+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <h2o__fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [154 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/lkwg82/h2o/refs/heads/master/include/h2o/memory.h:350:no memory\00"
define i8* @h2o_mem_alloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @h2o__fatal(i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [154 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/lkwg82/h2o/refs/heads/master/include/h2o/memory.h:350:no memory\00"
define noalias i8* @h2o_mem_alloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @h2o__fatal(i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
int _npy_signbit_d(double x) {
  union {
    double d;
    short s[4];
    int i[2];
  } u;
  u.d = x;
  return u.i[1] < 0;
}


x86 assembly (clang, -O0):
<_npy_signbit_d>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_npy_signbit_d>:
movmskpd %xmm0,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
%union.anon = type { double }
define i32 @_npy_signbit_d(double %0) {
%2 = alloca double
%3 = alloca %union.anon
store double %0, double* %2
%4 = load double, double* %2
%5 = bitcast %union.anon* %3 to double*
store double %4, double* %5
%6 = bitcast %union.anon* %3 to [2 x i32]*
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%8 = load i32, i32* %7
%9 = icmp slt i32 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @_npy_signbit_d(double %0) {
%2 = bitcast double %0 to i64
%3 = lshr i64 %2, 63
%4 = trunc i64 %3 to i32
ret i32 %4
}
void STO_BTSN(rr, len, reg, nn, bb) int *rr, len, reg, nn, bb;
{ MMS_BTSN(rr, reg, nn, nn, bb); }


x86 assembly (clang, -O0):
<STO_BTSN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    $0x0,%al
call   1030 <MMS_BTSN@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<STO_BTSN>:
mov    %edx,%esi
mov    %ecx,%edx
xor    %eax,%eax
jmp    1030 <MMS_BTSN@plt>

LLVM IR (-O0):
define void @STO_BTSN(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32*, i32** %6
%12 = load i32, i32* %8
%13 = load i32, i32* %9
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = call i32 (i32*, i32, i32, i32, i32, ...) bitcast (i32 (...)* @MMS_BTSN to i32 (i32*, i32, i32, i32, i32, ...)*)(i32* %11, i32 %12, i32 %13, i32 %14, i32 %15)
ret void
}

LLVM IR (-O2):
define void @STO_BTSN(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 (i32*, i32, i32, i32, i32, ...) bitcast (i32 (...)* @MMS_BTSN to i32 (i32*, i32, i32, i32, i32, ...)*)(i32* %0, i32 %2, i32 %3, i32 %3, i32 %4)
ret void
}
void lcase(register char *cp) {
  for (; *cp; cp++)
    *cp = ((((*cp) >= 'A') && ((*cp) <= 'Z')) ? (*cp + 32) : *cp);
}


x86 assembly (clang, -O0):
<lcase>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     116d <lcase+0x6d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jl     1147 <lcase+0x47>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     1147 <lcase+0x47>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
add    $0x20,%eax
mov    %eax,-0xc(%rbp)
jmp    1151 <lcase+0x51>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <lcase+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcase>:
mov    (%rdi),%al
test   %al,%al
je     1130 <lcase+0x30>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
lea    -0x41(%rax),%ecx
lea    0x20(%rax),%edx
cmp    $0x1a,%cl
movzbl %al,%eax
movzbl %dl,%ecx
cmovae %eax,%ecx
mov    %cl,-0x1(%rdi)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <lcase+0x10>
ret

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

LLVM IR (-O2):
define void @lcase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %11, %4 ], [ %0, %1 ]
%7 = add i8 %5, -65
%8 = icmp ult i8 %7, 26
%9 = add nuw nsw i8 %5, 32
%10 = select i1 %8, i8 %9, i8 %5
store i8 %10, i8* %6
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
ret void
}
/* Type definitions */
struct queue {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct queue *);
int /*<<< orphan*/ queue_destroy(struct queue *, void (*)(struct link *));
void queue_delete(struct queue *__restrict queue,
                  void (*data_delete)(struct link *)) {
  queue_destroy(queue, data_delete);
  free(queue);
}


x86 assembly (clang, -O0):
<queue_delete>:
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   1040 <queue_destroy@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<queue_delete>:
push   %rbx
mov    %rdi,%rbx
call   1040 <queue_destroy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.queue = type { i32 }
%struct.link = type opaque
%struct.link.0 = type opaque
define void @queue_delete(%struct.queue* noalias %0, void (%struct.link*)* %1) {
%3 = alloca %struct.queue*
%4 = alloca void (%struct.link*)*
store %struct.queue* %0, %struct.queue** %3
store void (%struct.link*)* %1, void (%struct.link*)** %4
%5 = load %struct.queue*, %struct.queue** %3
%6 = load void (%struct.link*)*, void (%struct.link*)** %4
%7 = bitcast void (%struct.link*)* %6 to void (%struct.link.0*)*
%8 = call i32 @queue_destroy(%struct.queue* %5, void (%struct.link.0*)* %7)
%9 = load %struct.queue*, %struct.queue** %3
%10 = call i32 @free(%struct.queue* %9)
ret void
}

LLVM IR (-O2):
%struct.queue = type { i32 }
%struct.link = type opaque
%struct.link.0 = type opaque
define void @queue_delete(%struct.queue* noalias %0, void (%struct.link*)* %1) {
%3 = bitcast void (%struct.link*)* %1 to void (%struct.link.0*)*
%4 = tail call i32 @queue_destroy(%struct.queue* %0, void (%struct.link.0*)* %3)
%5 = tail call i32 @free(%struct.queue* %0)
ret void
}
/* Variables and functions */
int pow(double, int);
double fprim(double v) { return 210 * pow(v, 2) - 6 * v + 4; }


x86 assembly (clang, -O0):
<fprim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
imul   $0xd2,%eax,%eax
cvtsi2sd %eax,%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  0xec5(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xead(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprim>:
push   %rax
movsd  %xmm0,(%rsp)
mov    $0x2,%edi
call   1030 <pow@plt>
imul   $0xd2,%eax,%eax
cvtsi2sd %eax,%xmm1
movsd  (%rsp),%xmm0
mulsd  0xec9(%rip),%xmm0
addsd  %xmm1,%xmm0
addsd  0xec5(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @fprim(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @pow(double %3, i32 2)
%5 = mul nsw i32 210, %4
%6 = sitofp i32 %5 to double
%7 = load double, double* %2
%8 = call double @llvm.fmuladd.f64(double -6.000000e+00, double %7, double %6)
%9 = fadd double %8, 4.000000e+00
ret double %9
}

LLVM IR (-O2):
define double @fprim(double %0) {
%2 = tail call i32 @pow(double %0, i32 2)
%3 = mul nsw i32 %2, 210
%4 = sitofp i32 %3 to double
%5 = tail call double @llvm.fmuladd.f64(double %0, double -6.000000e+00, double %4)
%6 = fadd double %5, 4.000000e+00
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ liste_fichiers(char *);
int liste_referentiels() { liste_fichiers("."); }


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

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

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
define i32 @liste_referentiels() {
%1 = alloca i32
%2 = call i32 @liste_fichiers(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
define i32 @liste_referentiels() {
%1 = tail call i32 @liste_fichiers(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
struct chat_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ chat_socket_printf(struct chat_data *, char *, int, char *,
                                      int);
void deny_file(struct chat_data *ch, char *arg) {
  chat_socket_printf(ch, "%c%s%c", 21, arg, 255);
}


x86 assembly (clang, -O0):
<deny_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
lea    0xed1(%rip),%rsi
mov    $0x15,%edx
mov    $0xff,%r8d
call   1030 <chat_socket_printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deny_file>:
mov    %rsi,%rcx
lea    0xee6(%rip),%rsi
mov    $0x15,%edx
mov    $0xff,%r8d
jmp    1030 <chat_socket_printf@plt>

LLVM IR (-O0):
%struct.chat_data = type { i32 }
@.str = [7 x i8] c"%c%s%c\00"
define void @deny_file(%struct.chat_data* %0, i8* %1) {
%3 = alloca %struct.chat_data*
%4 = alloca i8*
store %struct.chat_data* %0, %struct.chat_data** %3
store i8* %1, i8** %4
%5 = load %struct.chat_data*, %struct.chat_data** %3
%6 = load i8*, i8** %4
%7 = call i32 @chat_socket_printf(%struct.chat_data* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 21, i8* %6, i32 255)
ret void
}

LLVM IR (-O2):
%struct.chat_data = type { i32 }
@.str = [7 x i8] c"%c%s%c\00"
define void @deny_file(%struct.chat_data* %0, i8* %1) {
%3 = tail call i32 @chat_socket_printf(%struct.chat_data* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 21, i8* %1, i32 255)
ret void
}
/* Variables and functions */
char const *ERR_getErrorName(size_t);
const char *ZSTDv06_getErrorName(size_t code) { return ERR_getErrorName(code); }


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

x86 assembly (clang, -O2):
<ZSTDv06_getErrorName>:
jmp    1030 <ERR_getErrorName@plt>

LLVM IR (-O0):
define i8* @ZSTDv06_getErrorName(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @ERR_getErrorName(i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define i8* @ZSTDv06_getErrorName(i64 %0) {
%2 = tail call i8* @ERR_getErrorName(i64 %0)
ret i8* %2
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
double t2d(struct timeval tm) {
  return (double)tm.tv_sec + (double)tm.tv_usec / 1000000;
}


x86 assembly (clang, -O0):
<t2d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xee0(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<t2d>:
cvtsi2sd %rsi,%xmm1
cvtsi2sd %rdi,%xmm0
divsd  0xeee(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @t2d(i64 %0, i64 %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to { i64, i64 }*
%5 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %4, i32 0, i32 0
store i64 %0, i64* %5
%6 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %4, i32 0, i32 1
store i64 %1, i64* %6
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%11 = load i64, i64* %10
%12 = sitofp i64 %11 to double
%13 = fdiv double %12, 1.000000e+06
%14 = fadd double %9, %13
ret double %14
}

LLVM IR (-O2):
define double @t2d(i64 %0, i64 %1) {
%3 = sitofp i64 %1 to double
%4 = sitofp i64 %0 to double
%5 = fdiv double %4, 1.000000e+06
%6 = fadd double %5, %3
ret double %6
}
/* Variables and functions */
double mt_rand_32(int);
long double mt_rand_real(double n, int my_rank) {
  return mt_rand_32(my_rank) * (n / 4294967295.0);
}


x86 assembly (clang, -O0):
<mt_rand_real>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <mt_rand_32@plt>
movsd  -0x8(%rbp),%xmm1
movsd  0xecb(%rip),%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
fldl   -0x18(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mt_rand_real>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <mt_rand_32@plt>
movsd  0x8(%rsp),%xmm1
divsd  0xed3(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
fldl   0x10(%rsp)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @mt_rand_real(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call double @mt_rand_32(i32 %5)
%7 = load double, double* %3
%8 = fdiv double %7, 0x41EFFFFFFFE00000
%9 = fmul double %6, %8
%10 = fpext double %9 to x86_fp80
ret x86_fp80 %10
}

LLVM IR (-O2):
define x86_fp80 @mt_rand_real(double %0, i32 %1) {
%3 = tail call double @mt_rand_32(i32 %1)
%4 = fdiv double %0, 0x41EFFFFFFFE00000
%5 = fmul double %4, %3
%6 = fpext double %5 to x86_fp80
ret x86_fp80 %6
}
/* Variables and functions */
int doCommand(char *, int);
int athSetLongPreamble(int enable) {
  int ret = doCommand("--setlongpreamble %d\n", enable);
  return ret;
}


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

x86 assembly (clang, -O2):
<athSetLongPreamble>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <doCommand@plt>

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

LLVM IR (-O2):
@.str = [22 x i8] c"--setlongpreamble %d\0A\00"
define i32 @athSetLongPreamble(i32 %0) {
%2 = tail call i32 @doCommand(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 %2
}
g() { return 5; }


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

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

LLVM IR (-O0):
define i32 @g() {
ret i32 5
}

LLVM IR (-O2):
define i32 @g() {
ret i32 5
}
unsigned long int to_long_int_convertor(unsigned char array[]) {
  unsigned long int n;
  n = array[0];
  n <<= 8;
  n |= array[1];
  n <<= 8;
  n |= array[2];
  n <<= 8;
  n |= array[3];
  return n;
}


x86 assembly (clang, -O0):
<to_long_int_convertor>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_long_int_convertor>:
mov    (%rdi),%eax
shl    $0x20,%rax
bswap  %rax
ret

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

LLVM IR (-O2):
define i64 @to_long_int_convertor(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i64
%7 = shl nuw nsw i64 %3, 16
%8 = shl nuw nsw i64 %6, 8
%9 = or i64 %8, %7
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i64
%13 = or i64 %9, %12
%14 = shl nuw nsw i64 %13, 8
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i64
%18 = or i64 %14, %17
ret i64 %18
}
/* Variables and functions */
void *strdup(char const *);
void *my_strdup(const char *str, void *unused_data) { return strdup(str); }


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

x86 assembly (clang, -O2):
<my_strdup>:
jmp    1030 <strdup@plt>

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

LLVM IR (-O2):
define noalias i8* @my_strdup(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = tail call i8* @strdup(i8* %0)
ret i8* %3
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t bit_rotr_u64(uint64_t x, int r) {
  return ((x >> r) | (x << (64 - r)));
}


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

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

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

LLVM IR (-O2):
define i32 @bit_rotr_u64(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
%4 = sub nsw i32 64, %1
%5 = shl i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
double copysign(x, y)
double x, y;
{
  if ((x < 0 && y > 0) || (x > 0 && y < 0))
    return -x;
  return x;
}


x86 assembly (clang, -O0):
<copysign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112e <copysign+0x2e>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
ja     114e <copysign+0x4e>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1174 <copysign+0x74>
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1174 <copysign+0x74>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    117e <copysign+0x7e>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<copysign>:
xorpd  %xmm2,%xmm2
ucomisd %xmm0,%xmm2
jbe    1110 <copysign+0x10>
ucomisd %xmm2,%xmm1
ja     1120 <copysign+0x20>
ucomisd %xmm2,%xmm0
jbe    1128 <copysign+0x28>
xorpd  %xmm2,%xmm2
ucomisd %xmm1,%xmm2
jbe    1128 <copysign+0x28>
xorpd  0xed8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @copysign(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = fcmp olt double %6, 0.000000e+00
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load double, double* %5
%10 = fcmp ogt double %9, 0.000000e+00
br i1 %10, label %17, label %11
11: ; preds = %8, %2
%12 = load double, double* %4
%13 = fcmp ogt double %12, 0.000000e+00
br i1 %13, label %14, label %20
14: ; preds = %11
%15 = load double, double* %5
%16 = fcmp olt double %15, 0.000000e+00
br i1 %16, label %17, label %20
17: ; preds = %14, %8
%18 = load double, double* %4
%19 = fneg double %18
store double %19, double* %3
br label %22
20: ; preds = %14, %11
%21 = load double, double* %4
store double %21, double* %3
br label %22
22: ; preds = %20, %17
%23 = load double, double* %3
ret double %23
}

LLVM IR (-O2):
define double @copysign(double %0, double %1) {
%3 = fcmp olt double %0, 0.000000e+00
%4 = fcmp ogt double %1, 0.000000e+00
%5 = and i1 %3, %4
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = fcmp ogt double %0, 0.000000e+00
%8 = fcmp olt double %1, 0.000000e+00
%9 = and i1 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %6, %2
%11 = fneg double %0
br label %12
12: ; preds = %6, %10
%13 = phi double [ %11, %10 ], [ %0, %6 ]
ret double %13
}
/* Variables and functions */
int /*<<< orphan*/ assert(int *const);
void increment_value(int *const value) {
  assert(value);
  (*value)++;
}


x86 assembly (clang, -O0):
<increment_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<increment_value>:
push   %rbx
mov    %rdi,%rbx
call   1030 <assert@plt>
addl   $0x1,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @increment_value(i32* %0) {
%2 = tail call i32 @assert(i32* %0)
%3 = load i32, i32* %0
%4 = add nsw i32 %3, 1
store i32 %4, i32* %0
ret void
}
void gtk_tree_view_enable_model_drag_source() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_enable_model_drag_source() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ halt_printf(char *);
int /*<<< orphan*/ show_adb_log();
void adb_error(void) {
  halt_printf("Adb Error\n");
  show_adb_log();
}


x86 assembly (clang, -O0):
<adb_error>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <halt_printf@plt>
mov    $0x0,%al
call   1030 <show_adb_log@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"Adb Error\0A\00"
define void @adb_error() {
%1 = call i32 @halt_printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @show_adb_log()
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"Adb Error\0A\00"
define void @adb_error() {
%1 = tail call i32 @halt_printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @show_adb_log()
ret void
}
unsigned long hiBit(unsigned long u) { return u & 0x80000000UL; }


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

x86 assembly (clang, -O2):
<hiBit>:
mov    %rdi,%rax
and    $0x80000000,%eax
ret

LLVM IR (-O0):
define i64 @hiBit(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 2147483648
ret i64 %4
}

LLVM IR (-O2):
define i64 @hiBit(i64 %0) {
%2 = and i64 %0, 2147483648
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char *, size_t);
char *myrealloc(char *p, size_t old, size_t new) {
  char *pnew = malloc(new);
  if (pnew == NULL) {
    return NULL;
  }
  memcpy(pnew, p, old);
  free(p);
  return pnew;
}


x86 assembly (clang, -O0):
<myrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1169 <myrealloc+0x39>
movq   $0x0,-0x8(%rbp)
jmp    118b <myrealloc+0x5b>
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myrealloc>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rdx,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1161 <myrealloc+0x31>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @myrealloc(i8* %0, i64 %1, i64 %2) {
%4 = tail call i8* @malloc(i64 %2)
%5 = icmp eq i8* %4, null
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i32 @memcpy(i8* %4, i8* %0, i64 %1)
%8 = tail call i32 @free(i8* %0)
br label %9
9: ; preds = %3, %6
ret i8* %4
}
void ff_hevc_put_hevc_bi_w_pel_pixels4_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_pel_pixels4_8_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_int_hex(int);
int main() {
  test_int_hex(0xff);
  test_int_hex(0xdeadbeef);
  printf("hello world");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xff,%edi
call   1040 <test_int_hex@plt>
mov    $0xdeadbeef,%edi
call   1040 <test_int_hex@plt>
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"hello world\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @test_int_hex(i32 255)
%3 = call i32 @test_int_hex(i32 -559038737)
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"hello world\00"
define i32 @main() {
%1 = tail call i32 @test_int_hex(i32 255)
%2 = tail call i32 @test_int_hex(i32 -559038737)
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void buffer_move_backward_word(struct buffer *buf) {}


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

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

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

LLVM IR (-O2):
%struct.buffer = type opaque
define void @buffer_move_backward_word(%struct.buffer* nocapture %0) {
ret void
}
/* Variables and functions */
int QC_strncasecmp(char const *, char const *, int);
int QC_strcasecmp(const char *s1, const char *s2) {
  return QC_strncasecmp(s1, s2, 0x7fffffff);
}


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

x86 assembly (clang, -O2):
<QC_strcasecmp>:
mov    $0x7fffffff,%edx
jmp    1030 <QC_strncasecmp@plt>

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

LLVM IR (-O2):
define i32 @QC_strcasecmp(i8* %0, i8* %1) {
%3 = tail call i32 @QC_strncasecmp(i8* %0, i8* %1, i32 2147483647)
ret i32 %3
}
int cmodel_is_planar(int colormodel) {
  switch (colormodel) {
  case 7:
    return 1;
    break;
  case 17:
    return 1;
    break;
  case 27:
    return 1;
    break;
  case 18:
    return 1;
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<cmodel_is_planar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xfffffff9,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x14,%eax
ja     1160 <cmodel_is_planar+0x60>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    1167 <cmodel_is_planar+0x67>
movl   $0x1,-0x4(%rbp)
jmp    1167 <cmodel_is_planar+0x67>
movl   $0x1,-0x4(%rbp)
jmp    1167 <cmodel_is_planar+0x67>
movl   $0x1,-0x4(%rbp)
jmp    1167 <cmodel_is_planar+0x67>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmodel_is_planar>:
cmp    $0x1b,%edi
ja     1115 <cmodel_is_planar+0x15>
mov    $0x1,%eax
mov    $0x8060080,%ecx
bt     %edi,%ecx
jae    1115 <cmodel_is_planar+0x15>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @cmodel_is_planar(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %9 [
i32 7, label %5
i32 17, label %6
i32 27, label %7
i32 18, label %8
]
5: ; preds = %1
store i32 1, i32* %2
br label %10
6: ; preds = %1
store i32 1, i32* %2
br label %10
7: ; preds = %1
store i32 1, i32* %2
br label %10
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, %7, %6, %5
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @cmodel_is_planar(i32 %0) {
switch i32 %0, label %2 [
i32 7, label %3
i32 17, label %3
i32 27, label %3
i32 18, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main() {
  system("fgconsole > aivia_osmium_tty_getter_current_tty.txt");
  system("chmod 777 aivia_osmium_tty_getter_current_tty.txt");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <system@plt>
lea    0xf02(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [52 x i8] c"fgconsole > aivia_osmium_tty_getter_current_tty.txt\00"
@.str.1 = [50 x i8] c"chmod 777 aivia_osmium_tty_getter_current_tty.txt\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @system(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @system(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [52 x i8] c"fgconsole > aivia_osmium_tty_getter_current_tty.txt\00"
@.str.1 = [50 x i8] c"chmod 777 aivia_osmium_tty_getter_current_tty.txt\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char *strdup(char *);
size_t strlen(char *);
char *str_dup_and_rev(char *str, size_t *rlen) {
  size_t n = strlen(str);
  char *ret = strdup(str);
  if (!ret) {
    return 0;
  }
  *rlen = n;
  return ret;
}


x86 assembly (clang, -O0):
<str_dup_and_rev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1162 <str_dup_and_rev+0x42>
movq   $0x0,-0x8(%rbp)
jmp    1175 <str_dup_and_rev+0x55>
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_dup_and_rev>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rax,%r15
mov    %rbx,%rdi
call   1040 <strdup@plt>
test   %rax,%rax
je     1143 <str_dup_and_rev+0x23>
mov    %r15,(%r14)
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define noalias i8* @str_dup_and_rev(i8* nocapture %0, i64* nocapture writeonly %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i8* @strdup(i8* %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %2
store i64 %3, i64* %1
br label %7
7: ; preds = %2, %6
ret i8* %4
}