xunge/DecIR huggingface dataset:
void dv3o_mult(double *output, double *a, double *b) {
  output[0] = a[0] * b[0];
  output[1] = a[1] * b[1];
  output[2] = a[2] * b[2];
}


x86 assembly (clang, -O0):
<dv3o_mult>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
mulsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x18(%rbp),%rax
mulsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dv3o_mult>:
movsd  (%rsi),%xmm0
mulsd  (%rdx),%xmm0
movsd  %xmm0,(%rdi)
movsd  0x8(%rsi),%xmm0
mulsd  0x8(%rdx),%xmm0
movsd  %xmm0,0x8(%rdi)
movsd  0x10(%rsi),%xmm0
mulsd  0x10(%rdx),%xmm0
movsd  %xmm0,0x10(%rdi)
ret

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

LLVM IR (-O2):
define void @dv3o_mult(double* nocapture writeonly %0, double* nocapture %1, double* nocapture %2) {
%4 = load double, double* %1
%5 = load double, double* %2
%6 = fmul double %4, %5
store double %6, double* %0
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %2, i64 1
%10 = load double, double* %9
%11 = fmul double %8, %10
%12 = getelementptr inbounds double, double* %0, i64 1
store double %11, double* %12
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = getelementptr inbounds double, double* %2, i64 2
%16 = load double, double* %15
%17 = fmul double %14, %16
%18 = getelementptr inbounds double, double* %0, i64 2
store double %17, double* %18
ret void
}
float Clamp(float value, float min, float max) {
  const float res = value < min ? min : value;
  return res > max ? max : res;
}


x86 assembly (clang, -O0):
<Clamp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1135 <Clamp+0x35>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    113f <Clamp+0x3f>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1167 <Clamp+0x67>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
jmp    1171 <Clamp+0x71>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Clamp>:
maxss  %xmm0,%xmm1
minss  %xmm1,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @Clamp(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%8 = load float, float* %4
%9 = load float, float* %5
%10 = fcmp olt float %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load float, float* %5
br label %15
13: ; preds = %3
%14 = load float, float* %4
br label %15
15: ; preds = %13, %11
%16 = phi float [ %12, %11 ], [ %14, %13 ]
store float %16, float* %7
%17 = load float, float* %7
%18 = load float, float* %6
%19 = fcmp ogt float %17, %18
br i1 %19, label %20, label %22
20: ; preds = %15
%21 = load float, float* %6
br label %24
22: ; preds = %15
%23 = load float, float* %7
br label %24
24: ; preds = %22, %20
%25 = phi float [ %21, %20 ], [ %23, %22 ]
ret float %25
}

LLVM IR (-O2):
define float @Clamp(float %0, float %1, float %2) {
%4 = fcmp olt float %0, %1
%5 = select i1 %4, float %1, float %0
%6 = fcmp ogt float %5, %2
%7 = select i1 %6, float %2, float %5
ret float %7
}
/* Variables and functions */
int pin_to_bank_offset(unsigned int);
unsigned pin_to_mask(unsigned pin) { return 1 << pin_to_bank_offset(pin); }


x86 assembly (clang, -O0):
<pin_to_mask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <pin_to_bank_offset@plt>
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pin_to_mask>:
push   %rax
call   1030 <pin_to_bank_offset@plt>
mov    $0x1,%edx
mov    %eax,%ecx
shl    %cl,%edx
mov    %edx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @pin_to_mask(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @pin_to_bank_offset(i32 %3)
%5 = shl i32 1, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @pin_to_mask(i32 %0) {
%2 = tail call i32 @pin_to_bank_offset(i32 %0)
%3 = shl nuw i32 1, %2
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t cblByteOrderSwap16HostToLittle(uint16_t swap) { return swap; }


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

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

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

LLVM IR (-O2):
define i32 @cblByteOrderSwap16HostToLittle(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int determine_output_during_continuation(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(71, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<determine_output_during_continuation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x47,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<determine_output_during_continuation>:
mov    $0x47,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @determine_output_during_continuation() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 71, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @determine_output_during_continuation() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 71, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Type definitions */
typedef void pthread_rwlock_t;

/* Variables and functions */
void *calloc(int, int);
int /*<<< orphan*/ pthread_rwlock_init(void *, int /*<<< orphan*/ *);
void *kl_pthread_rwlock_new(void *data) {
  pthread_rwlock_t *Mutex = calloc(1, sizeof(pthread_rwlock_t));
  ;
  pthread_rwlock_init(Mutex, NULL);
  return Mutex;
}


x86 assembly (clang, -O0):
<kl_pthread_rwlock_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%esi
mov    %esi,%edi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <pthread_rwlock_init@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kl_pthread_rwlock_new>:
push   %rbx
mov    $0x1,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
call   1040 <pthread_rwlock_init@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @kl_pthread_rwlock_new(i8* nocapture readnone %0) {
%2 = tail call dereferenceable_or_null(1) i8* @calloc(i32 1, i32 1)
%3 = tail call i32 @pthread_rwlock_init(i8* %2, i32* null)
ret i8* %2
}
/* Variables and functions */
int foo(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("Result: %d\n", foo(1, 2));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"Result: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @foo(i32 1, i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef size_t ssize_t;

/* Variables and functions */
ssize_t swallow(int fd, const void *buf, size_t count) { return count; }


x86 assembly (clang, -O0):
<swallow>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swallow>:
mov    %rdx,%rax
ret

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

LLVM IR (-O2):
define i64 @swallow(i32 %0, i8* nocapture readnone %1, i64 returned %2) {
ret i64 %2
}
void setBitL(int *buffer, int offset) {
  int num = offset / 32;
  buffer[num] |= (0x80000000 >> (offset - num * 32));
}


x86 assembly (clang, -O0):
<setBitL>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%eax
shl    $0x5,%eax
sub    %eax,%ecx
mov    $0x80000000,%edx
shr    %cl,%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
or     (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setBitL>:
mov    %esi,%ecx
lea    0x1f(%rcx),%eax
test   %esi,%esi
cmovns %esi,%eax
mov    %eax,%edx
sar    $0x5,%edx
and    $0xffffffe0,%eax
sub    %eax,%ecx
mov    $0x80000000,%eax
shr    %cl,%eax
movslq %edx,%rcx
or     %eax,(%rdi,%rcx,4)
ret

LLVM IR (-O0):
define void @setBitL(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = sdiv i32 %6, 32
store i32 %7, i32* %5
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = mul nsw i32 %9, 32
%11 = sub nsw i32 %8, %10
%12 = lshr i32 -2147483648, %11
%13 = load i32*, i32** %3
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = or i32 %17, %12
store i32 %18, i32* %16
ret void
}

LLVM IR (-O2):
define void @setBitL(i32* nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 32
%4 = mul i32 %3, -32
%5 = add i32 %4, %1
%6 = lshr i32 -2147483648, %5
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = or i32 %9, %6
store i32 %10, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ err1(char *);
void rex_err(void) { err1("cannot use high register in rex instruction"); }


x86 assembly (clang, -O0):
<rex_err>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <err1@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [44 x i8] c"cannot use high register in rex instruction\00"
define void @rex_err() {
%1 = call i32 @err1(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"cannot use high register in rex instruction\00"
define void @rex_err() {
%1 = tail call i32 @err1(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init(char *);
int ok();
int /*<<< orphan*/ test();
int main() {
  init("do loop");
  test();
  return ok();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <init@plt>
mov    $0x0,%al
call   1050 <test@plt>
mov    $0x0,%al
call   1030 <ok@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <init@plt>
xor    %eax,%eax
call   1050 <test@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <ok@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"do loop\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @init(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @test()
%4 = call i32 (...) @ok()
ret i32 %4
}

LLVM IR (-O2):
@.str = [8 x i8] c"do loop\00"
define i32 @main() {
%1 = tail call i32 @init(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @test()
%3 = tail call i32 (...) @ok()
ret i32 %3
}
/* Variables and functions */
char *strchr(char const *, char);
const char *fpext(const char *filename) {
  const char *dot = strchr(filename, '.');
  if (!dot || dot == filename)
    return "";
  return dot + 1;
}


x86 assembly (clang, -O0):
<fpext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1147 <fpext+0x37>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    1157 <fpext+0x47>
lea    0xeb2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1163 <fpext+0x53>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fpext>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2e,%esi
call   1030 <strchr@plt>
lea    0x1(%rax),%rcx
cmp    %rbx,%rax
lea    0xed4(%rip),%rdx
cmove  %rdx,%rcx
test   %rax,%rax
cmove  %rdx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @fpext(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strchr(i8* %5, i8 signext 46)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i8*, i8** %4
%11 = load i8*, i8** %3
%12 = icmp eq i8* %10, %11
br i1 %12, label %13, label %14
13: ; preds = %9, %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %17
14: ; preds = %9
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8* %16, i8** %2
br label %17
17: ; preds = %14, %13
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @fpext(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 46)
%3 = icmp eq i8* %2, null
%4 = icmp eq i8* %2, %0
%5 = or i1 %3, %4
%6 = getelementptr inbounds i8, i8* %2, i64 1
%7 = select i1 %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %6
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ sync_tx();
int /*<<< orphan*/ sys_sleep(int);
int /*<<< orphan*/ vars_free(int /*<<< orphan*/);
void *exec_cleanup(void *arg) {
  for (;;) {
    sys_sleep(30);
    vars_free(sync_tx());
  }
  return ((void *)0);
}


x86 assembly (clang, -O0):
<exec_cleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1e,%edi
call   1050 <sys_sleep@plt>
mov    $0x0,%al
call   1040 <sync_tx@plt>
mov    %eax,%edi
call   1030 <vars_free@plt>
jmp    113c <exec_cleanup+0xc>

x86 assembly (clang, -O2):
<exec_cleanup>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1e,%edi
call   1050 <sys_sleep@plt>
xor    %eax,%eax
call   1040 <sync_tx@plt>
mov    %eax,%edi
call   1030 <vars_free@plt>
jmp    1140 <exec_cleanup+0x10>

LLVM IR (-O0):
define i8* @exec_cleanup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %3, %1
%4 = call i32 @sys_sleep(i32 30)
%5 = call i32 (...) @sync_tx()
%6 = call i32 @vars_free(i32 %5)
br label %3
}

LLVM IR (-O2):
define noalias i8* @exec_cleanup(i8* nocapture readnone %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @sys_sleep(i32 30)
%4 = tail call i32 (...) @sync_tx()
%5 = tail call i32 @vars_free(i32 %4)
br label %2
}
/* Variables and functions */
char *corta_string(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char *s = "Campos verdes";
  while (*(s = corta_string(s)) != ' ')
    ;
  s = corta_string(s);
  printf("%s\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <corta_string@plt>
mov    %rax,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x20,%eax
je     1158 <main+0x38>
jmp    113a <main+0x1a>
mov    -0x10(%rbp),%rdi
call   1040 <corta_string@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rax
nopl   0x0(%rax,%rax,1)
mov    %rax,%rdi
call   1040 <corta_string@plt>
cmpb   $0x20,(%rax)
jne    1130 <main+0x10>
mov    %rax,%rdi
call   1040 <corta_string@plt>
lea    0xec2(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Campos verdes\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %2
br label %3
3: ; preds = %9, %0
%4 = load i8*, i8** %2
%5 = call i8* @corta_string(i8* %4)
store i8* %5, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 32
br i1 %8, label %9, label %10
9: ; preds = %3
br label %3
10: ; preds = %3
%11 = load i8*, i8** %2
%12 = call i8* @corta_string(i8* %11)
store i8* %12, i8** %2
%13 = load i8*, i8** %2
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Campos verdes\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i8* [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), %0 ], [ %3, %1 ]
%3 = tail call i8* @corta_string(i8* %2)
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 32
br i1 %5, label %6, label %1
6: ; preds = %1
%7 = tail call i8* @corta_string(i8* %3)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void testFreeNonMallocPointerWithNoOffset() {
  char c;
  char *r = &c;
  r = r + 10;
  free(r - 10);
}


x86 assembly (clang, -O0):
<testFreeNonMallocPointerWithNoOffset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x1(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0xa,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0xfffffffffffffff6,%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @testFreeNonMallocPointerWithNoOffset() {
%1 = alloca i8
%2 = alloca i8*
store i8* %1, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 10
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 -10
%7 = call i32 @free(i8* %6)
ret void
}

LLVM IR (-O2):
define void @testFreeNonMallocPointerWithNoOffset() {
%1 = alloca i8
%2 = call i32 @free(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ accel_write_single(int, int, int);
void accel_run() {
  accel_write_single(0x3A, 0x2A, 0x00);
  accel_write_single(0x38, 0x2A, 0x00);
  accel_write_single(0x38, 0x0E, 0x02);
  accel_write_single(0x3A, 0x2A, 0x01);
  accel_write_single(0x38, 0x2A, 0x01);
}


x86 assembly (clang, -O0):
<accel_run>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3a,%edi
mov    $0x2a,%esi
xor    %edx,%edx
call   1030 <accel_write_single@plt>
mov    $0x38,%edi
mov    $0x2a,%esi
xor    %edx,%edx
call   1030 <accel_write_single@plt>
mov    $0x38,%edi
mov    $0xe,%esi
mov    $0x2,%edx
call   1030 <accel_write_single@plt>
mov    $0x3a,%edi
mov    $0x2a,%esi
mov    $0x1,%edx
call   1030 <accel_write_single@plt>
mov    $0x38,%edi
mov    $0x2a,%esi
mov    $0x1,%edx
call   1030 <accel_write_single@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<accel_run>:
push   %rax
mov    $0x3a,%edi
mov    $0x2a,%esi
xor    %edx,%edx
call   1030 <accel_write_single@plt>
mov    $0x38,%edi
mov    $0x2a,%esi
xor    %edx,%edx
call   1030 <accel_write_single@plt>
mov    $0x38,%edi
mov    $0xe,%esi
mov    $0x2,%edx
call   1030 <accel_write_single@plt>
mov    $0x3a,%edi
mov    $0x2a,%esi
mov    $0x1,%edx
call   1030 <accel_write_single@plt>
mov    $0x38,%edi
mov    $0x2a,%esi
mov    $0x1,%edx
pop    %rax
jmp    1030 <accel_write_single@plt>

LLVM IR (-O0):
define void @accel_run() {
%1 = call i32 @accel_write_single(i32 58, i32 42, i32 0)
%2 = call i32 @accel_write_single(i32 56, i32 42, i32 0)
%3 = call i32 @accel_write_single(i32 56, i32 14, i32 2)
%4 = call i32 @accel_write_single(i32 58, i32 42, i32 1)
%5 = call i32 @accel_write_single(i32 56, i32 42, i32 1)
ret void
}

LLVM IR (-O2):
define void @accel_run() {
%1 = tail call i32 @accel_write_single(i32 58, i32 42, i32 0)
%2 = tail call i32 @accel_write_single(i32 56, i32 42, i32 0)
%3 = tail call i32 @accel_write_single(i32 56, i32 14, i32 2)
%4 = tail call i32 @accel_write_single(i32 58, i32 42, i32 1)
%5 = tail call i32 @accel_write_single(i32 56, i32 42, i32 1)
ret void
}
int test_imm_0Auint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x0A << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_0Auint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 10
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
double f4_cb_send_pre_double_double_double(double (*cb)(double, double,
                                                        double)) {
  double r = 66.0;
  return cb(8.25, 9.25, r) + 1.0;
}


x86 assembly (clang, -O0):
<f4_cb_send_pre_double_double_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movsd  0xf04(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  -0x10(%rbp),%xmm2
movsd  0xede(%rip),%xmm0
movsd  0xede(%rip),%xmm1
call   *%rax
movsd  0xec4(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_cb_send_pre_double_double_double>:
push   %rax
movsd  0xef7(%rip),%xmm0
movsd  0xef7(%rip),%xmm1
movsd  0xef7(%rip),%xmm2
call   *%rdi
addsd  0xef5(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f4_cb_send_pre_double_double_double(double (double, double, double)* %0) {
%2 = alloca double (double, double, double)*
%3 = alloca double
store double (double, double, double)* %0, double (double, double, double)** %2
store double 6.600000e+01, double* %3
%4 = load double (double, double, double)*, double (double, double, double)** %2
%5 = load double, double* %3
%6 = call double %4(double 8.250000e+00, double 9.250000e+00, double %5)
%7 = fadd double %6, 1.000000e+00
ret double %7
}

LLVM IR (-O2):
define double @f4_cb_send_pre_double_double_double(double (double, double, double)* nocapture %0) {
%2 = tail call double %0(double 8.250000e+00, double 9.250000e+00, double 6.600000e+01)
%3 = fadd double %2, 1.000000e+00
ret double %3
}
int sexy(x)
unsigned x;
{ return ((x & 0xff) << 8) | ((x & 0xff00) >> 8); }


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

x86 assembly (clang, -O2):
<sexy>:
rol    $0x8,%di
movzwl %di,%eax
ret

LLVM IR (-O0):
define i32 @sexy(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = shl i32 %4, 8
%6 = load i32, i32* %2
%7 = and i32 %6, 65280
%8 = lshr i32 %7, 8
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @sexy(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
%4 = zext i16 %3 to i32
ret i32 %4
}
int m(int y) {
  int x = 1;
  y = y + x;
  return y;
}


x86 assembly (clang, -O0):
<m>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<m>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @m(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
int __attribute__((no)) foo(int a, int b) { return a + b; }


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

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

LLVM IR (-O0):
define i32 @foo(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ op_write1(int);
void op_enc_ret_z(void) { op_write1(0xc8); }


x86 assembly (clang, -O0):
<op_enc_ret_z>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc8,%edi
call   1030 <op_write1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_enc_ret_z>:
mov    $0xc8,%edi
jmp    1030 <op_write1@plt>

LLVM IR (-O0):
define void @op_enc_ret_z() {
%1 = call i32 @op_write1(i32 200)
ret void
}

LLVM IR (-O2):
define void @op_enc_ret_z() {
%1 = tail call i32 @op_write1(i32 200)
ret void
}
void foo(void *ptr, int test) { (ptr - ((void *)test + 0x2000)); }


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

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

LLVM IR (-O0):
define void @foo(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i8*
%9 = getelementptr i8, i8* %8, i64 8192
%10 = ptrtoint i8* %5 to i64
%11 = ptrtoint i8* %9 to i64
%12 = sub i64 %10, %11
ret void
}

LLVM IR (-O2):
define void @foo(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int error(int, char *);
int b_limit(int argc, char *argv[]) {
  if (argc > 1)
    error(1, argv[0]);
  return error(49, argv[0]);
}


x86 assembly (clang, -O0):
<b_limit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    113a <b_limit+0x2a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    $0x1,%edi
call   1030 <error@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    $0x31,%edi
call   1030 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_limit>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x2,%edi
jl     1126 <b_limit+0x16>
mov    (%rbx),%rsi
mov    $0x1,%edi
call   1030 <error@plt>
mov    (%rbx),%rsi
mov    $0x31,%edi
pop    %rbx
jmp    1030 <error@plt>

LLVM IR (-O0):
define i32 @b_limit(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = icmp sgt i32 %5, 1
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i8**, i8*** %4
%9 = getelementptr inbounds i8*, i8** %8, i64 0
%10 = load i8*, i8** %9
%11 = call i32 @error(i32 1, i8* %10)
br label %12
12: ; preds = %7, %2
%13 = load i8**, i8*** %4
%14 = getelementptr inbounds i8*, i8** %13, i64 0
%15 = load i8*, i8** %14
%16 = call i32 @error(i32 49, i8* %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @b_limit(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @error(i32 1, i8* %5)
br label %7
7: ; preds = %4, %2
%8 = load i8*, i8** %1
%9 = tail call i32 @error(i32 49, i8* %8)
ret i32 %9
}
void I2C1_ER_IRQHandler() {}


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

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

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

LLVM IR (-O2):
define void @I2C1_ER_IRQHandler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, char *, size_t);
void clib_get(void *destination, void *source, size_t size) {
  memcpy(destination, (char *)source, size);
}


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

x86 assembly (clang, -O2):
<clib_get>:
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @clib_get(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %2)
ret void
}
/* Type definitions */
struct wsgi_request {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ log_request(struct wsgi_request *);
void uwsgi_php_after_request(struct wsgi_request *wsgi_req) {
  log_request(wsgi_req);
}


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

x86 assembly (clang, -O2):
<uwsgi_php_after_request>:
jmp    1030 <log_request@plt>

LLVM IR (-O0):
%struct.wsgi_request = type { i32 }
define void @uwsgi_php_after_request(%struct.wsgi_request* %0) {
%2 = alloca %struct.wsgi_request*
store %struct.wsgi_request* %0, %struct.wsgi_request** %2
%3 = load %struct.wsgi_request*, %struct.wsgi_request** %2
%4 = call i32 @log_request(%struct.wsgi_request* %3)
ret void
}

LLVM IR (-O2):
%struct.wsgi_request = type { i32 }
define void @uwsgi_php_after_request(%struct.wsgi_request* %0) {
%2 = tail call i32 @log_request(%struct.wsgi_request* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, size_t const, char *, int /*<<< orphan*/,
                            int, int /*<<< orphan*/);
int pthread_ctf_version(char *buf, const size_t len) {
  (void)snprintf(buf, len, "%d.%d.%d", 0, 1, 0);
  return 0;
}


x86 assembly (clang, -O0):
<pthread_ctf_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0xed1(%rip),%rdx
xor    %r9d,%r9d
mov    $0x1,%r8d
mov    %r9d,%ecx
call   1030 <snprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_ctf_version>:
push   %rax
lea    0xee8(%rip),%rdx
xor    %ecx,%ecx
mov    $0x1,%r8d
xor    %r9d,%r9d
call   1030 <snprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d.%d.%d\00"
define i32 @pthread_ctf_version(i8* %0, i64 %1) {
%3 = tail call i32 @snprintf(i8* %0, i64 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 0, i32 1, i32 0)
ret i32 0
}
/* Type definitions */
struct stat {
  int st_size;
};

/* Variables and functions */
int /*<<< orphan*/ perror(char *);
scalar_t__ stat(char *, struct stat *);
int GetFileSize(char *name) {
  if (NULL == name)
    return -1;
  struct stat st;
  if (stat(name, &st) < 0) {
    perror("stat failed");
    return -1;
  }
  return st.st_size;
}


x86 assembly (clang, -O0):
<GetFileSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1144 <GetFileSize+0x24>
movl   $0xffffffff,-0x4(%rbp)
jmp    1179 <GetFileSize+0x59>
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jge    1173 <GetFileSize+0x53>
lea    0xe9e(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1179 <GetFileSize+0x59>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetFileSize>:
test   %rdi,%rdi
je     113b <GetFileSize+0x1b>
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %rax,%rax
js     1141 <GetFileSize+0x21>
mov    (%rsp),%eax
add    $0x8,%rsp
ret
mov    $0xffffffff,%eax
ret
lea    0xeb8(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [12 x i8] c"stat failed\00"
define i32 @GetFileSize(i8* %0) {
%2 = alloca %struct.stat
%3 = icmp eq i8* %0, null
br i1 %3, label %15, label %4
4: ; preds = %1
%5 = bitcast %struct.stat* %2 to i8*
%6 = call i64 @stat(i8* %0, %struct.stat* %2)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %13
10: ; preds = %4
%11 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%12 = load i32, i32* %11
br label %13
13: ; preds = %10, %8
%14 = phi i32 [ -1, %8 ], [ %12, %10 ]
br label %15
15: ; preds = %1, %13
%16 = phi i32 [ %14, %13 ], [ -1, %1 ]
ret i32 %16
}
long int transform_long_int(const long int in) { return 123 * in; }


x86 assembly (clang, -O0):
<transform_long_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
imul   $0x7b,-0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<transform_long_int>:
imul   $0x7b,%rdi,%rax
ret

LLVM IR (-O0):
define i64 @transform_long_int(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul nsw i64 123, %3
ret i64 %4
}

LLVM IR (-O2):
define i64 @transform_long_int(i64 %0) {
%2 = mul nsw i64 %0, 123
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void COMP1_2_3_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @COMP1_2_3_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @COMP1_2_3_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Variables and functions */
unsigned int dns_packet_copy(char *, unsigned int, unsigned int, char *,
                             unsigned int);
int /*<<< orphan*/ err(int, char *);
unsigned int x_copy(char *buf, unsigned int len, unsigned int pos, char *out,
                    unsigned int outlen) {
  pos = dns_packet_copy(buf, len, pos, out, outlen);
  if (!pos)
    err(-1, "could not parse AXFR results");
  return pos;
}


x86 assembly (clang, -O0):
<x_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
call   1030 <dns_packet_copy@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    116f <x_copy+0x4f>
mov    $0xffffffff,%edi
lea    0xe96(%rip),%rsi
call   1040 <err@plt>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_copy>:
push   %rbx
call   1030 <dns_packet_copy@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    113d <x_copy+0x1d>
lea    0xecd(%rip),%rsi
mov    $0xffffffff,%edi
call   1040 <err@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"could not parse AXFR results\00"
define i32 @x_copy(i8* %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i8*, i8** %9
%15 = load i32, i32* %10
%16 = call i32 @dns_packet_copy(i8* %11, i32 %12, i32 %13, i8* %14, i32 %15)
store i32 %16, i32* %8
%17 = load i32, i32* %8
%18 = icmp ne i32 %17, 0
br i1 %18, label %21, label %19
19: ; preds = %5
%20 = call i32 @err(i32 -1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %21
21: ; preds = %19, %5
%22 = load i32, i32* %8
ret i32 %22
}

LLVM IR (-O2):
@.str = [29 x i8] c"could not parse AXFR results\00"
define i32 @x_copy(i8* %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = tail call i32 @dns_packet_copy(i8* %0, i32 %1, i32 %2, i8* %3, i32 %4)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @err(i32 -1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
ret i32 %6
}
unsigned xrop3_2_1_1(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;
  stk2 = T | S;
  stk2 = ~stk2;
  stk1 = D & stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_2_1_1>:
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,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @xrop3_2_1_1(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
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = load i32, i32* %6
%24 = or i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %9
%26 = xor i32 %25, -1
store i32 %26, i32* %9
%27 = load i32, i32* %5
%28 = load i32, i32* %9
%29 = and i32 %27, %28
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = load i32, i32* %6
%32 = xor i32 %31, -1
%33 = and i32 %30, %32
%34 = load i32, i32* %7
%35 = xor i32 %34, -1
%36 = and i32 %33, %35
%37 = load i32, i32* %5
%38 = load i32, i32* %6
%39 = and i32 %37, %38
%40 = or i32 %36, %39
%41 = load i32, i32* %5
%42 = load i32, i32* %7
%43 = and i32 %41, %42
%44 = or i32 %40, %43
ret i32 %44
}

LLVM IR (-O2):
define i32 @xrop3_2_1_1(i8 zeroext %0, i8 zeroext %1) {
ret i32 255
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_server_credentials_release() {
  fprintf(stderr, "Should never reach here");
  abort();
}


x86 assembly (clang, -O0):
<grpcsharp_server_credentials_release>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_server_credentials_release() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_server_credentials_release() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
int main() {
  char str[] = {"abc"};
  printf("Calling my permuation function for the string value %s\n", str);
  my_permutation(str, 0, strlen(str));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xebb(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x8(%rbp),%rsi
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %rax,%rdx
xor    %esi,%esi
mov    $0x0,%al
call   1050 <my_permutation@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x636261,0xc(%rsp)
lea    0xebc(%rip),%rdi
lea    0xc(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %rax,%rdx
xor    %eax,%eax
call   1050 <my_permutation@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str = [4 x i8] c"abc\00"
@.str = [56 x i8] c"Calling my permuation function for the string value %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i8]
store i32 0, i32* %1
%3 = bitcast [4 x i8]* %2 to i8*
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%8 = call i64 @strlen(i8* %7)
%9 = call i32 (i8*, i32, i64, ...) bitcast (i32 (...)* @my_permutation to i32 (i8*, i32, i64, ...)*)(i8* %6, i32 0, i64 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [56 x i8] c"Calling my permuation function for the string value %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 6513249, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i64 @strlen(i8* %2)
%5 = call i32 (i8*, i32, i64, ...) bitcast (i32 (...)* @my_permutation to i32 (i8*, i32, i64, ...)*)(i8* %2, i32 0, i64 %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ sleep(int /*<<< orphan*/);
extern void oosmos_DelaySeconds(uint32_t Seconds) { sleep(Seconds); }


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

x86 assembly (clang, -O2):
<oosmos_DelaySeconds>:
jmp    1030 <sleep@plt>

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

LLVM IR (-O2):
define void @oosmos_DelaySeconds(i32 %0) {
%2 = tail call i32 @sleep(i32 %0)
ret void
}
int f_i5(int i0, int i1, int i2, int i3, int i4) { return i4; }


x86 assembly (clang, -O0):
<f_i5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_i5>:
mov    %r8d,%eax
ret

LLVM IR (-O0):
define i32 @f_i5(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* %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @f_i5(i32 %0, i32 %1, i32 %2, i32 %3, i32 returned %4) {
ret i32 %4
}