xunge/DecIR huggingface dataset:
void ff_hevc_idct_16x16_10_avx() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_idct_16x16_10_avx() {
ret void
}
void INT_Excep_PERIB_INTB138(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIB_INTB138() {
ret void
}
prompt(toot, s) int toot;
char *s;
{
  if (toot)
    error();
  clrprompt();
  prints(s);
}


x86 assembly (clang, -O0):
<prompt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1150 <prompt+0x20>
mov    $0x0,%al
call   1040 <error@plt>
mov    $0x0,%al
call   1050 <clrprompt@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <prints@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prompt>:
push   %rbx
mov    %rsi,%rbx
test   %edi,%edi
je     113f <prompt+0xf>
xor    %eax,%eax
call   1040 <error@plt>
xor    %eax,%eax
call   1050 <clrprompt@plt>
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <prints@plt>

LLVM IR (-O0):
define i32 @prompt(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @error()
br label %10
10: ; preds = %8, %2
%11 = call i32 (...) @clrprompt()
%12 = load i8*, i8** %5
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @prints to i32 (i8*, ...)*)(i8* %12)
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @prompt(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @error()
br label %6
6: ; preds = %4, %2
%7 = tail call i32 (...) @clrprompt()
%8 = tail call i32 (i8*, ...) bitcast (i32 (...)* @prints to i32 (i8*, ...)*)(i8* %1)
ret i32 undef
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void rcc_enable_gpio(uint32_t selGPIO, uint32_t enable) {
  uint32_t *pRCC;
  pRCC = (uint32_t *)(0x40023800 + 0x30);
  *pRCC &= ~(0x01 << selGPIO);
  *pRCC |= (enable << selGPIO);
}


x86 assembly (clang, -O0):
<rcc_enable_gpio>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x40023830,%eax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
xor    $0xffffffff,%ecx
mov    -0x10(%rbp),%rax
and    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    %cl,%eax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rcc_enable_gpio>:
mov    %edi,%ecx
shl    %cl,%esi
mov    0x40023830,%eax
btr    %edi,%eax
or     %eax,%esi
mov    %esi,0x40023830
ret

LLVM IR (-O0):
define void @rcc_enable_gpio(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32* inttoptr (i64 1073887280 to i32*), i32** %5
%6 = load i32, i32* %3
%7 = shl i32 1, %6
%8 = xor i32 %7, -1
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = and i32 %10, %8
store i32 %11, i32* %9
%12 = load i32, i32* %4
%13 = load i32, i32* %3
%14 = shl i32 %12, %13
%15 = load i32*, i32** %5
%16 = load i32, i32* %15
%17 = or i32 %16, %14
store i32 %17, i32* %15
ret void
}

LLVM IR (-O2):
define void @rcc_enable_gpio(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %0
%4 = xor i32 %3, -1
%5 = load i32, i32* inttoptr (i64 1073887280 to i32*)
%6 = and i32 %5, %4
%7 = shl i32 %1, %0
%8 = or i32 %6, %7
store i32 %8, i32* inttoptr (i64 1073887280 to i32*)
ret void
}
void debug_printf(const char *str, ...) {}


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

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

LLVM IR (-O0):
define void @debug_printf(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @debug_printf(i8* nocapture %0, ...) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int64_t;
typedef int /*<<< orphan*/ u_int32_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int xmp_trim(u_int64_t from, u_int32_t len, void *userdata) {
  (void)(userdata);
  fprintf(stderr, "T - %lu, %u\n", from, len);
  return 0;
}


x86 assembly (clang, -O0):
<xmp_trim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xec8(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmp_trim>:
push   %rax
mov    %esi,%ecx
mov    %edi,%edx
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
lea    0xedb(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [13 x i8] c"T - %lu, %u\0A\00"
define i32 @xmp_trim(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = load i32, i32* @stderr
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"T - %lu, %u\0A\00"
define i32 @xmp_trim(i32 %0, i32 %1, i8* nocapture readnone %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret i32 0
}
double normalize_data(double *range, double n, double min, double max) {
  return range[0] + (range[1] - range[0]) * ((n - min) / (max - min));
}


x86 assembly (clang, -O0):
<normalize_data>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm0
movsd  -0x10(%rbp),%xmm2
subsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
subsd  -0x18(%rbp),%xmm3
divsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<normalize_data>:
movsd  (%rdi),%xmm3
movsd  0x8(%rdi),%xmm4
subsd  %xmm3,%xmm4
subsd  %xmm1,%xmm0
subsd  %xmm1,%xmm2
divsd  %xmm2,%xmm0
mulsd  %xmm4,%xmm0
addsd  %xmm3,%xmm0
ret

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

LLVM IR (-O2):
define double @normalize_data(double* nocapture %0, double %1, double %2, double %3) {
%5 = load double, double* %0
%6 = getelementptr inbounds double, double* %0, i64 1
%7 = load double, double* %6
%8 = fsub double %7, %5
%9 = fsub double %1, %2
%10 = fsub double %3, %2
%11 = fdiv double %9, %10
%12 = tail call double @llvm.fmuladd.f64(double %8, double %11, double %5)
ret double %12
}
char *next_token(s)
char *s;
{
  register char *p = s;
  while (*p == ' ' || *p == '\t' || *p == '\f')
    ++p;
  return p;
}


x86 assembly (clang, -O0):
<next_token>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x11(%rbp)
je     114a <next_token+0x4a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x11(%rbp)
je     114a <next_token+0x4a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xc,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    115a <next_token+0x5a>
jmp    116b <next_token+0x6b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <next_token+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_token>:
mov    %rdi,%rax
movabs $0x100001200,%rcx
nopl   (%rax)
movzbl (%rax),%edx
cmp    $0x20,%rdx
ja     1125 <next_token+0x25>
bt     %rdx,%rcx
jae    1125 <next_token+0x25>
add    $0x1,%rax
jmp    1110 <next_token+0x10>
ret

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

LLVM IR (-O2):
define i8* @next_token(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 32, label %5
i8 9, label %5
i8 12, label %5
]
5: ; preds = %2, %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
/* Variables and functions */
char *strchr(char const *, int);
int strlen(char const *);
const char *my_strchrnul(const char *s, int c) {
  const char *ptr = strchr(s, c);
  if (!ptr)
    ptr = s + strlen(s);
  return ptr;
}


x86 assembly (clang, -O0):
<my_strchrnul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116b <my_strchrnul+0x4b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strchrnul>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strchr@plt>
test   %rax,%rax
je     1130 <my_strchrnul+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
add    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @my_strchrnul(i8* %0, i32 %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @strlen(i8* %0)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
br label %9
9: ; preds = %5, %2
%10 = phi i8* [ %3, %2 ], [ %8, %5 ]
ret i8* %10
}
/* Type definitions */
struct ccd_frame {
  int dummy;
};

/* Variables and functions */
struct ccd_frame *new_frame_fr(int /*<<< orphan*/ *, unsigned int,
                               unsigned int);
struct ccd_frame *new_frame(unsigned size_x, unsigned size_y) {
  return new_frame_fr(NULL, size_x, size_y);
}


x86 assembly (clang, -O0):
<new_frame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
xor    %eax,%eax
mov    %eax,%edi
call   1030 <new_frame_fr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_frame>:
mov    %esi,%edx
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <new_frame_fr@plt>

LLVM IR (-O0):
%struct.ccd_frame = type { i32 }
define %struct.ccd_frame* @new_frame(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call %struct.ccd_frame* @new_frame_fr(i32* null, i32 %5, i32 %6)
ret %struct.ccd_frame* %7
}

LLVM IR (-O2):
%struct.ccd_frame = type { i32 }
define %struct.ccd_frame* @new_frame(i32 %0, i32 %1) {
%3 = tail call %struct.ccd_frame* @new_frame_fr(i32* null, i32 %0, i32 %1)
ret %struct.ccd_frame* %3
}
void _debug() { printf("Exception: %s\n", __FUNCTION__); }


x86 assembly (clang, -O0):
<_debug>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeed(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_debug>:
lea    0xee9(%rip),%rdi
lea    0xef1(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Exception: %s\0A\00"
@__FUNCTION__._debug = [7 x i8] c"_debug\00"
define void @_debug() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__FUNCTION__._debug, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Exception: %s\0A\00"
@__FUNCTION__._debug = [7 x i8] c"_debug\00"
define void @_debug() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__FUNCTION__._debug, i64 0, i64 0))
ret void
}
/* Variables and functions */
size_t strlen(const char *str) {
  int k = 0;
  while (*str++) {
    k++;
  }
  return k;
}


x86 assembly (clang, -O0):
<strlen>:
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)
cmpb   $0x0,(%rax)
je     1135 <strlen+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
movslq -0xc(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111f <strlen+0x1f>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, 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
%12 = zext i32 %8 to i64
br label %13
13: ; preds = %11, %1
%14 = phi i64 [ 0, %1 ], [ %12, %11 ]
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ EVP_cleanup();
void EAC_cleanup(void) { EVP_cleanup(); }


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

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

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

LLVM IR (-O2):
define void @EAC_cleanup() {
%1 = tail call i32 (...) @EVP_cleanup()
ret void
}
/* Type definitions */
struct bitstream_reader {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct bitstream_reader *);
void free_bitstream_reader(struct bitstream_reader *bs) { free(bs); }


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

x86 assembly (clang, -O2):
<free_bitstream_reader>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.bitstream_reader = type { i32 }
define void @free_bitstream_reader(%struct.bitstream_reader* nocapture %0) {
%2 = tail call i32 @free(%struct.bitstream_reader* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
void clear_classes(int **classes, int nbClass) {
  int i;
  for (i = 0; i < nbClass; i++)
    free(classes[i]);
}


x86 assembly (clang, -O0):
<clear_classes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <clear_classes+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <clear_classes+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_classes>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1142 <clear_classes+0x32>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <clear_classes+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @clear_classes(i32** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32*, i32** %0, i64 %7
%9 = load i32*, i32** %8
%10 = tail call i32 @free(i32* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int openat(int, char *, int /*<<< orphan*/);
int ro_openat(int fd, char *str) { return openat(fd, str, O_RDONLY); }


x86 assembly (clang, -O0):
<ro_openat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    0x2ebb(%rip),%rax
mov    (%rax),%edx
call   1030 <openat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ro_openat>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edx
jmp    1030 <openat@plt>

LLVM IR (-O0):
@O_RDONLY = global i32 0
define i32 @ro_openat(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 = load i8*, i8** %4
%7 = load i32, i32* @O_RDONLY
%8 = call i32 @openat(i32 %5, i8* %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
define i32 @ro_openat(i32 %0, i8* %1) {
%3 = load i32, i32* @O_RDONLY
%4 = tail call i32 @openat(i32 %0, i8* %1, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void DymosimMessageNoNL(const char *message) { printf("%s", message); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @DymosimMessageNoNL(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void swapch(char *a, char *b) {
  char t = *a;
  *a = *b;
  *b = t;
}


x86 assembly (clang, -O0):
<swapch>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapch>:
mov    (%rdi),%al
mov    (%rsi),%cl
mov    %cl,(%rdi)
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define void @swapch(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
store i8 %7, i8* %5
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = load i8*, i8** %3
store i8 %9, i8* %10
%11 = load i8, i8* %5
%12 = load i8*, i8** %4
store i8 %11, i8* %12
ret void
}

LLVM IR (-O2):
define void @swapch(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
store i8 %4, i8* %0
store i8 %3, i8* %1
ret void
}
/* Variables and functions */
char *interactive_text_stdio(char *, char *, int *, int *);
char *interactive_text(char *prompt, char *initval, int *is_blank, int *error) {
  return interactive_text_stdio(prompt, initval, is_blank, error);
}


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

x86 assembly (clang, -O2):
<interactive_text>:
jmp    1030 <interactive_text_stdio@plt>

LLVM IR (-O0):
define i8* @interactive_text(i8* %0, i8* %1, i32* %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i32*, i32** %7
%12 = load i32*, i32** %8
%13 = call i8* @interactive_text_stdio(i8* %9, i8* %10, i32* %11, i32* %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @interactive_text(i8* %0, i8* %1, i32* %2, i32* %3) {
%5 = tail call i8* @interactive_text_stdio(i8* %0, i8* %1, i32* %2, i32* %3)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ log_printf(int, char *);
scalar_t__ umount2(char *, int /*<<< orphan*/);
int resctrl_umount(void) {
  if (umount2("/sys/fs/resctrl", 0) != 0) {
    log_printf((1 << 2), "ERROR: "
                         "Could not umount resctrl filesystem!\n");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<resctrl_umount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
xor    %esi,%esi
call   1030 <umount2@plt>
cmp    $0x0,%rax
je     115d <resctrl_umount+0x3d>
mov    $0x4,%edi
lea    0xec4(%rip),%rsi
call   1040 <log_printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1164 <resctrl_umount+0x44>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resctrl_umount>:
push   %rbx
lea    0xed8(%rip),%rdi
xor    %ebx,%ebx
xor    %esi,%esi
call   1030 <umount2@plt>
test   %rax,%rax
je     114c <resctrl_umount+0x2c>
lea    0xed3(%rip),%rsi
mov    $0x4,%edi
call   1040 <log_printf@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"/sys/fs/resctrl\00"
@.str.1 = [45 x i8] c"ERROR: Could not umount resctrl filesystem!\0A\00"
define i32 @resctrl_umount() {
%1 = alloca i32
%2 = call i64 @umount2(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 0)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @log_printf(i32 4, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %1
br label %7
6: ; preds = %0
store i32 0, i32* %1
br label %7
7: ; preds = %6, %4
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@.str = [16 x i8] c"/sys/fs/resctrl\00"
@.str.1 = [45 x i8] c"ERROR: Could not umount resctrl filesystem!\0A\00"
define i32 @resctrl_umount() {
%1 = tail call i64 @umount2(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @log_printf(i32 4, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ 1, %3 ], [ 0, %0 ]
ret i32 %6
}
int do_192() { return 192; }


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

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

LLVM IR (-O0):
define i32 @do_192() {
ret i32 192
}

LLVM IR (-O2):
define i32 @do_192() {
ret i32 192
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void cerrarBloque(FILE *f) { fprintf(f, "}\n"); }


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

x86 assembly (clang, -O2):
<cerrarBloque>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"}\0A\00"
define void @cerrarBloque(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 2, i64 1, i32* %0)
ret void
}
/* Variables and functions */
double mysin(double);
double bar(double x) { return mysin(x); }


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

x86 assembly (clang, -O2):
<bar>:
jmp    1030 <mysin@plt>

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

LLVM IR (-O2):
define double @bar(double %0) {
%2 = tail call double @mysin(double %0)
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
size_t fmt_bytes_hex_reverse(char *, int /*<<< orphan*/ *, int);
size_t fmt_u32_hex(char *out, uint32_t val) {
  return fmt_bytes_hex_reverse(out, (uint8_t *)&val, 4);
}


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

x86 assembly (clang, -O2):
<fmt_u32_hex>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <fmt_bytes_hex_reverse@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i64 @fmt_u32_hex(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 = call i64 @fmt_bytes_hex_reverse(i8* %5, i32* %4, i32 4)
ret i64 %6
}

LLVM IR (-O2):
define i64 @fmt_u32_hex(i8* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i64 @fmt_bytes_hex_reverse(i8* %0, i32* %3, i32 4)
ret i64 %4
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_dev;
};
typedef int /*<<< orphan*/ dev_t;

/* Variables and functions */
int /*<<< orphan*/ fstat(int, struct stat *);
int getfd(char const *);
dev_t getdev(const char *fname) {
  int fd = getfd(fname);
  struct stat st;
  fstat(fd, &st);
  return st.st_dev;
}


x86 assembly (clang, -O0):
<getdev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getfd@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1040 <fstat@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getdev>:
push   %rax
call   1030 <getfd@plt>
mov    %rsp,%rsi
mov    %eax,%edi
call   1040 <fstat@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @getdev(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.stat
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @getfd(i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @fstat(i32 %7, %struct.stat* %4)
%9 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%10 = load i32, i32* %9
ret i32 %10
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @getdev(i8* %0) {
%2 = alloca %struct.stat
%3 = tail call i32 @getfd(i8* %0)
%4 = bitcast %struct.stat* %2 to i8*
%5 = call i32 @fstat(i32 %3, %struct.stat* %2)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ KDGETLED;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ ioctl(int /*<<< orphan*/, int /*<<< orphan*/, char *);
int /*<<< orphan*/ perror(char *);
void get_LED_flags(char *current_led_flags) {
  if (ioctl(0, KDGETLED, current_led_flags)) {
    perror("ioctl KDGETLED");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<get_LED_flags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
xor    %edi,%edi
call   1030 <ioctl@plt>
cmp    $0x0,%rax
je     1174 <get_LED_flags+0x44>
lea    0xe9f(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_LED_flags>:
push   %rax
mov    %rdi,%rdx
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
call   1030 <ioctl@plt>
test   %rax,%rax
jne    114b <get_LED_flags+0x1b>
pop    %rax
ret
lea    0xeae(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@KDGETLED = global i32 0
@.str = [15 x i8] c"ioctl KDGETLED\00"
@EXIT_FAILURE = global i32 0
define void @get_LED_flags(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @KDGETLED
%4 = load i8*, i8** %2
%5 = call i64 @ioctl(i32 0, i32 %3, i8* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
ret void
}

LLVM IR (-O2):
@KDGETLED = global i32 0
@.str = [15 x i8] c"ioctl KDGETLED\00"
@EXIT_FAILURE = global i32 0
define void @get_LED_flags(i8* %0) {
%2 = load i32, i32* @KDGETLED
%3 = tail call i64 @ioctl(i32 0, i32 %2, i8* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret void
}
void RandomFunc(unsigned long input[1], unsigned long output[1]) {
  unsigned long state[1];
  {
    state[0UL] = (input[0UL] + 914778474UL) - 981234615UL;
    if (state[0UL] & 1UL) {
      state[0UL] += state[0UL];
    }
    output[0UL] = (state[0UL] + 690137161UL) - 1817474074UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0x3686696a,%rax
sub    $0x3a7c73b7,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     1141 <RandomFunc+0x41>
mov    -0x18(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
add    $0x2922a849,%rcx
sub    $0x6c54741a,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    $0xfffffffffc09f5b3,%rax
add    (%rdi),%rax
mov    %eax,%ecx
and    $0x1,%cl
shl    %cl,%rax
add    $0xffffffffbcce342f,%rax
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca [1 x i64]
store i64* %0, i64** %3
store i64* %1, i64** %4
%6 = load i64*, i64** %3
%7 = getelementptr inbounds i64, i64* %6, i64 0
%8 = load i64, i64* %7
%9 = add i64 %8, 914778474
%10 = sub i64 %9, 981234615
%11 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
store i64 %10, i64* %11
%12 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%13 = load i64, i64* %12
%14 = and i64 %13, 1
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %22
16: ; preds = %2
%17 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%18 = load i64, i64* %17
%19 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%20 = load i64, i64* %19
%21 = add i64 %20, %18
store i64 %21, i64* %19
br label %22
22: ; preds = %16, %2
%23 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%24 = load i64, i64* %23
%25 = add i64 %24, 690137161
%26 = sub i64 %25, 1817474074
%27 = load i64*, i64** %4
%28 = getelementptr inbounds i64, i64* %27, i64 0
store i64 %26, i64* %28
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i64* nocapture %0, i64* nocapture writeonly %1) {
%3 = load i64, i64* %0
%4 = add i64 %3, -66456141
%5 = and i64 %4, 1
%6 = shl i64 %4, %5
%7 = add i64 %6, -1127336913
store i64 %7, i64* %1
ret void
}
/* Variables and functions */
int op4(int, int /*<<< orphan*/);
int test_4(void) { return op4(1, 0); }


x86 assembly (clang, -O0):
<test_4>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <op4@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_4>:
mov    $0x1,%edi
xor    %esi,%esi
jmp    1030 <op4@plt>

LLVM IR (-O0):
define i32 @test_4() {
%1 = call i32 @op4(i32 1, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @test_4() {
%1 = tail call i32 @op4(i32 1, i32 0)
ret i32 %1
}
/* Type definitions */
union bpf_attr {
  int map_fd;
  void *value;
  void *key;
};
typedef int /*<<< orphan*/ attr;

/* Variables and functions */
int /*<<< orphan*/ BPF_MAP_LOOKUP_ELEM;
int bpf(int /*<<< orphan*/, union bpf_attr *, int);
void *bpf_ptr_to_u64(void *);
int bpf_map_lookup(int fd, const void *key, void *value) {
  union bpf_attr attr = {};
  attr.map_fd = fd;
  attr.key = bpf_ptr_to_u64(key);
  attr.value = bpf_ptr_to_u64(value);
  return bpf(BPF_MAP_LOOKUP_ELEM, &attr, sizeof(attr));
}


x86 assembly (clang, -O0):
<bpf_map_lookup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0xec6(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <bpf_ptr_to_u64@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <bpf_ptr_to_u64@plt>
mov    %rax,-0x20(%rbp)
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
lea    -0x20(%rbp),%rsi
mov    $0x8,%edx
call   1030 <bpf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_map_lookup>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
mov    %rsi,%rdi
call   1040 <bpf_ptr_to_u64@plt>
mov    %rbx,%rdi
call   1040 <bpf_ptr_to_u64@plt>
mov    %rax,0x8(%rsp)
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
mov    $0x8,%edx
call   1030 <bpf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%union.bpf_attr = type { i8* }
@__const.bpf_map_lookup.attr = { i32, [4 x i8] } { i32 0, [4 x i8] undef }
@BPF_MAP_LOOKUP_ELEM = global i32 0
define i32 @bpf_map_lookup(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca %union.bpf_attr
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = bitcast %union.bpf_attr* %7 to i8*
%9 = load i32, i32* %4
%10 = bitcast %union.bpf_attr* %7 to i32*
store i32 %9, i32* %10
%11 = load i8*, i8** %5
%12 = call i8* @bpf_ptr_to_u64(i8* %11)
%13 = bitcast %union.bpf_attr* %7 to i8**
store i8* %12, i8** %13
%14 = load i8*, i8** %6
%15 = call i8* @bpf_ptr_to_u64(i8* %14)
%16 = bitcast %union.bpf_attr* %7 to i8**
store i8* %15, i8** %16
%17 = load i32, i32* @BPF_MAP_LOOKUP_ELEM
%18 = call i32 @bpf(i32 %17, %union.bpf_attr* %7, i32 8)
ret i32 %18
}

LLVM IR (-O2):
%union.bpf_attr = type { i8* }
@BPF_MAP_LOOKUP_ELEM = global i32 0
define i32 @bpf_map_lookup(i32 %0, i8* %1, i8* %2) {
%4 = alloca %union.bpf_attr
%5 = bitcast %union.bpf_attr* %4 to i8*
%6 = tail call i8* @bpf_ptr_to_u64(i8* %1)
%7 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %4, i64 0, i32 0
%8 = tail call i8* @bpf_ptr_to_u64(i8* %2)
store i8* %8, i8** %7
%9 = load i32, i32* @BPF_MAP_LOOKUP_ELEM
%10 = call i32 @bpf(i32 %9, %union.bpf_attr* %4, i32 8)
ret i32 %10
}
void main(void) {
  unsigned char data;
  struct {
    unsigned char red;
    unsigned char green;
    unsigned char blue;
  } rgb;
  rgb.red = 255;
  rgb.green = 0;
  rgb.blue = 128;
  data = rgb.red;
  data = rgb.green;
  data = rgb.blue;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movb   $0xff,-0x8(%rbp)
movb   $0x0,-0x7(%rbp)
movb   $0x80,-0x6(%rbp)
mov    -0x8(%rbp),%al
mov    %al,-0x1(%rbp)
mov    -0x7(%rbp),%al
mov    %al,-0x1(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.anon = type { i8, i8, i8 }
define void @main() {
%1 = alloca i8
%2 = alloca %struct.anon
%3 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 0
store i8 -1, i8* %3
%4 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 1
store i8 0, i8* %4
%5 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 2
store i8 -128, i8* %5
%6 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 0
%7 = load i8, i8* %6
store i8 %7, i8* %1
%8 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 1
%9 = load i8, i8* %8
store i8 %9, i8* %1
%10 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 2
%11 = load i8, i8* %10
store i8 %11, i8* %1
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
char *xstrdup(char const *);
char *chase_symlinks(const char *pathspec) { return xstrdup(pathspec); }


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

x86 assembly (clang, -O2):
<chase_symlinks>:
jmp    1030 <xstrdup@plt>

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

LLVM IR (-O2):
define i8* @chase_symlinks(i8* %0) {
%2 = tail call i8* @xstrdup(i8* %0)
ret i8* %2
}
/* Variables and functions */
char *strrchr(char *, char);
char *getFilenameExt(char *filename) {
  char *dot = strrchr(filename, '.');
  if (!dot || dot == filename)
    return "";
  return dot + 1;
}


x86 assembly (clang, -O0):
<getFilenameExt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1147 <getFilenameExt+0x37>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    1157 <getFilenameExt+0x47>
lea    0xeb2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1163 <getFilenameExt+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):
<getFilenameExt>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2e,%esi
call   1030 <strrchr@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* @getFilenameExt(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strrchr(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* @getFilenameExt(i8* %0) {
%2 = tail call i8* @strrchr(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
}
int fn_32(int flag) {
  int x = 4, y = 5;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmisleading-indentation"
  if (flag)
    x = 3;
  y = 2;
#pragma GCC diagnostic pop
  return x * y;
}


x86 assembly (clang, -O0):
<fn_32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1126 <fn_32+0x26>
movl   $0x3,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_32>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
add    %eax,%eax
add    $0x6,%eax
ret

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

LLVM IR (-O2):
define i32 @fn_32(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 8, i32 6
ret i32 %3
}
/* Variables and functions */
double DSlater_4S_6S(double, double, double);
double DSlater_6S_4S(double rij, double xii, double xij) {
  return DSlater_4S_6S(rij, xij, xii);
}


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

x86 assembly (clang, -O2):
<DSlater_6S_4S>:
movaps %xmm1,%xmm3
movaps %xmm2,%xmm1
movaps %xmm3,%xmm2
jmp    1030 <DSlater_4S_6S@plt>

LLVM IR (-O0):
define double @DSlater_6S_4S(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* %4
%8 = load double, double* %6
%9 = load double, double* %5
%10 = call double @DSlater_4S_6S(double %7, double %8, double %9)
ret double %10
}

LLVM IR (-O2):
define double @DSlater_6S_4S(double %0, double %1, double %2) {
%4 = tail call double @DSlater_4S_6S(double %0, double %2, double %1)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ holdit();
int /*<<< orphan*/ println(char *);
int /*<<< orphan*/ rm(char *);
int /*<<< orphan*/ sm(char *);
int /*<<< orphan*/ vt_move(int, int);
int tst_DECTCEM(const char *the_title) {
  vt_move(1, 1);
  rm("?25");
  println("The cursor should be invisible");
  holdit();
  sm("?25");
  println("The cursor should be visible again");
  return 1;
}


x86 assembly (clang, -O0):
<tst_DECTCEM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%esi
mov    %esi,%edi
call   1040 <vt_move@plt>
lea    0xe91(%rip),%rdi
call   1030 <rm@plt>
lea    0xe89(%rip),%rdi
call   1050 <println@plt>
mov    $0x0,%al
call   1070 <holdit@plt>
lea    0xe72(%rip),%rdi
call   1060 <sm@plt>
lea    0xe89(%rip),%rdi
call   1050 <println@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tst_DECTCEM>:
push   %rbx
mov    $0x1,%edi
mov    $0x1,%esi
call   1040 <vt_move@plt>
lea    0xe99(%rip),%rbx
mov    %rbx,%rdi
call   1030 <rm@plt>
lea    0xe8e(%rip),%rdi
call   1050 <println@plt>
xor    %eax,%eax
call   1070 <holdit@plt>
mov    %rbx,%rdi
call   1060 <sm@plt>
lea    0xe92(%rip),%rdi
call   1050 <println@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"?25\00"
@.str.1 = [31 x i8] c"The cursor should be invisible\00"
@.str.2 = [35 x i8] c"The cursor should be visible again\00"
define i32 @tst_DECTCEM(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @vt_move(i32 1, i32 1)
%4 = call i32 @rm(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @println(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (...) @holdit()
%7 = call i32 @sm(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @println(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [4 x i8] c"?25\00"
@.str.1 = [31 x i8] c"The cursor should be invisible\00"
@.str.2 = [35 x i8] c"The cursor should be visible again\00"
define i32 @tst_DECTCEM(i8* nocapture readnone %0) {
%2 = tail call i32 @vt_move(i32 1, i32 1)
%3 = tail call i32 @rm(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @println(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 (...) @holdit()
%6 = tail call i32 @sm(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @println(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
ret i32 1
}