xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse_c_string(char *);
int main() {
  char *str = "mutation";
  printf("%s\n", str);
  reverse_c_string(str);
  printf("%s\n", str);
  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),%rsi
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <reverse_c_string@plt>
mov    -0x10(%rbp),%rsi
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xede(%rip),%r14
lea    0xece(%rip),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <reverse_c_string@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c"mutation\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 ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @reverse_c_string(i8* %5)
%7 = load i8*, i8** %2
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"mutation\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @reverse_c_string(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mvprintw(int, int, char *, char *);
int /*<<< orphan*/ refresh();
void ledOff(int i, int y) {
  mvprintw(i, y, "%s", ".");
  refresh();
}


x86 assembly (clang, -O0):
<ledOff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    0xec5(%rip),%rdx
lea    0xec1(%rip),%rcx
call   1040 <mvprintw@plt>
mov    $0x0,%al
call   1030 <refresh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ledOff>:
push   %rax
lea    0xed8(%rip),%rdx
lea    0xed4(%rip),%rcx
call   1040 <mvprintw@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <refresh@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [2 x i8] c".\00"
define void @ledOff(i32 %0, i32 %1) {
%3 = tail call i32 @mvprintw(i32 %0, i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (...) @refresh()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("No FIPS DSA support\n");
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"No FIPS DSA support\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [20 x i8] c"No FIPS DSA support\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t co_min(uint32_t a, uint32_t b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<co_min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <co_min+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <co_min+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<co_min>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @co_min(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp slt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @co_min(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
double M_PI;
double get_rad_from_deg(double deg) { return deg * M_PI / 180; }


x86 assembly (clang, -O0):
<get_rad_from_deg>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2ed3(%rip),%rax
mulsd  (%rax),%xmm0
movsd  0xedf(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_rad_from_deg>:
mov    0x2ee1(%rip),%rax
mulsd  (%rax),%xmm0
divsd  0xeed(%rip),%xmm0
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @get_rad_from_deg(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* @M_PI
%5 = fmul double %3, %4
%6 = fdiv double %5, 1.800000e+02
ret double %6
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @get_rad_from_deg(double %0) {
%2 = load double, double* @M_PI
%3 = fmul double %2, %0
%4 = fdiv double %3, 1.800000e+02
ret double %4
}
void confTimerA0() {}


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

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

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

LLVM IR (-O2):
define void @confTimerA0() {
ret void
}
long exponent(long base, long power) {
  long result = 1;
  long i, temp;
  for (i = 0; i < power; i++) {
    temp = result * base;
    result = temp;
  }
  return result;
}


x86 assembly (clang, -O0):
<exponent>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1150 <exponent+0x50>
mov    -0x18(%rbp),%rax
imul   -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111c <exponent+0x1c>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<exponent>:
test   %rsi,%rsi
jle    111b <exponent+0x1b>
lea    -0x1(%rsi),%rax
mov    %esi,%ecx
and    $0x7,%ecx
cmp    $0x7,%rax
jae    1121 <exponent+0x21>
mov    $0x1,%eax
jmp    1156 <exponent+0x56>
mov    $0x1,%eax
ret
and    $0xfffffffffffffff8,%rsi
mov    $0x1,%eax
nopw   0x0(%rax,%rax,1)
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
add    $0xfffffffffffffff8,%rsi
jne    1130 <exponent+0x30>
test   %rcx,%rcx
je     116a <exponent+0x6a>
nopl   0x0(%rax,%rax,1)
imul   %rdi,%rax
add    $0xffffffffffffffff,%rcx
jne    1160 <exponent+0x60>
ret

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

LLVM IR (-O2):
define i64 @exponent(i64 %0, i64 %1) {
%3 = icmp sgt i64 %1, 0
br i1 %3, label %4, label %33
4: ; preds = %2
%5 = add i64 %1, -1
%6 = and i64 %1, 7
%7 = icmp ult i64 %5, 7
br i1 %7, label %23, label %8
8: ; preds = %4
%9 = and i64 %1, -8
br label %10
10: ; preds = %10, %8
%11 = phi i64 [ 1, %8 ], [ %20, %10 ]
%12 = phi i64 [ 0, %8 ], [ %21, %10 ]
%13 = mul nsw i64 %11, %0
%14 = mul nsw i64 %13, %0
%15 = mul nsw i64 %14, %0
%16 = mul nsw i64 %15, %0
%17 = mul nsw i64 %16, %0
%18 = mul nsw i64 %17, %0
%19 = mul nsw i64 %18, %0
%20 = mul nsw i64 %19, %0
%21 = add i64 %12, 8
%22 = icmp eq i64 %21, %9
br i1 %22, label %23, label %10
23: ; preds = %10, %4
%24 = phi i64 [ undef, %4 ], [ %20, %10 ]
%25 = phi i64 [ 1, %4 ], [ %20, %10 ]
%26 = icmp eq i64 %6, 0
br i1 %26, label %33, label %27
27: ; preds = %23, %27
%28 = phi i64 [ %30, %27 ], [ %25, %23 ]
%29 = phi i64 [ %31, %27 ], [ 0, %23 ]
%30 = mul nsw i64 %28, %0
%31 = add i64 %29, 1
%32 = icmp eq i64 %31, %6
br i1 %32, label %33, label %27
33: ; preds = %23, %27, %2
%34 = phi i64 [ 1, %2 ], [ %24, %23 ], [ %30, %27 ]
ret i64 %34
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("cpufreq-aperf [OPTIONS]\n\n"
         "-c [ --cpu ] CPU               "
         "The CPU core to measure - default all cores\n"
         "-i [ --intervall ] seconds     "
         "Refresh rate - default 1 second\n"
         "-o [ --once ]                  "
         "Exit after one intervall\n"
         "-h [ --help ]                  "
         "This help text\n"
         "The msr driver must be loaded for this command to work\n");
}


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

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

LLVM IR (-O0):
@.str = [321 x i8] c"cpufreq-aperf [OPTIONS]\0A\0A-c [ --cpu ] CPU The CPU core to measure - default all cores\0A-i [ --intervall ] seconds Refresh rate - default 1 second\0A-o [ --once ] Exit after one intervall\0A-h [ --help ] This help text\0AThe msr driver must be loaded for this command to work\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([321 x i8], [321 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [320 x i8] c"cpufreq-aperf [OPTIONS]\0A\0A-c [ --cpu ] CPU The CPU core to measure - default all cores\0A-i [ --intervall ] seconds Refresh rate - default 1 second\0A-o [ --once ] Exit after one intervall\0A-h [ --help ] This help text\0AThe msr driver must be loaded for this command to work\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([320 x i8], [320 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ RAND_MAX;
int /*<<< orphan*/ assert(int);
double const log(double);
scalar_t__ rand();
double izk_PoissonNeuron_getNewSpikeTime(const double spikeRate) {
  assert(spikeRate >= 0.0);
  const double uRand = (double)rand() / (double)RAND_MAX * 1.0;
  return -log(1.0 - uRand) / spikeRate;
}


x86 assembly (clang, -O0):
<izk_PoissonNeuron_getNewSpikeTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x0,%al
call   1050 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2e7f(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe86(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xe75(%rip),%xmm0
subsd  -0x10(%rbp),%xmm0
call   1040 <log@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<izk_PoissonNeuron_getNewSpikeTime>:
push   %rax
movsd  %xmm0,(%rsp)
xorpd  %xmm1,%xmm1
xor    %edi,%edi
ucomisd %xmm1,%xmm0
setae  %dil
call   1030 <assert@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %rax,%xmm1
mov    0x2e89(%rip),%rax
xorps  %xmm0,%xmm0
cvtsi2sdq (%rax),%xmm0
divsd  %xmm0,%xmm1
movsd  0xe8d(%rip),%xmm0
subsd  %xmm1,%xmm0
call   1040 <log@plt>
xorpd  0xe8c(%rip),%xmm0
divsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @izk_PoissonNeuron_getNewSpikeTime(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fcmp oge double %4, 0.000000e+00
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = call i64 (...) @rand()
%9 = sitofp i64 %8 to double
%10 = load i64, i64* @RAND_MAX
%11 = sitofp i64 %10 to double
%12 = fdiv double %9, %11
%13 = fmul double %12, 1.000000e+00
store double %13, double* %3
%14 = load double, double* %3
%15 = fsub double 1.000000e+00, %14
%16 = call double @log(double %15)
%17 = fneg double %16
%18 = load double, double* %2
%19 = fdiv double %17, %18
ret double %19
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @izk_PoissonNeuron_getNewSpikeTime(double %0) {
%2 = fcmp oge double %0, 0.000000e+00
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i64 (...) @rand()
%6 = sitofp i64 %5 to double
%7 = load i64, i64* @RAND_MAX
%8 = sitofp i64 %7 to double
%9 = fdiv double %6, %8
%10 = fsub double 1.000000e+00, %9
%11 = tail call double @log(double %10)
%12 = fneg double %11
%13 = fdiv double %12, %0
ret double %13
}
/* Type definitions */
struct smack_accesses {
  int dummy;
};

/* Variables and functions */
int accesses_apply(struct smack_accesses *, int);
int smack_accesses_clear(struct smack_accesses *handle) {
  return accesses_apply(handle, 1);
}


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

x86 assembly (clang, -O2):
<smack_accesses_clear>:
mov    $0x1,%esi
jmp    1030 <accesses_apply@plt>

LLVM IR (-O0):
%struct.smack_accesses = type { i32 }
define i32 @smack_accesses_clear(%struct.smack_accesses* %0) {
%2 = alloca %struct.smack_accesses*
store %struct.smack_accesses* %0, %struct.smack_accesses** %2
%3 = load %struct.smack_accesses*, %struct.smack_accesses** %2
%4 = call i32 @accesses_apply(%struct.smack_accesses* %3, i32 1)
ret i32 %4
}

LLVM IR (-O2):
%struct.smack_accesses = type { i32 }
define i32 @smack_accesses_clear(%struct.smack_accesses* %0) {
%2 = tail call i32 @accesses_apply(%struct.smack_accesses* %0, i32 1)
ret i32 %2
}
/* Variables and functions */
char getc();
scalar_t__ isalpha(char);
char toupper(char);
char get_key() {
  char key;
  while (1) {
    key = getc();
    if (isalpha(key))
      return toupper(key);
  }
}


x86 assembly (clang, -O0):
<get_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <getc@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <isalpha@plt>
cmp    $0x0,%rax
je     1167 <get_key+0x37>
movsbl -0x1(%rbp),%edi
call   1030 <toupper@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret
jmp    1138 <get_key+0x8>

x86 assembly (clang, -O2):
<get_key>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <getc@plt>
movsbl %al,%ebx
mov    %ebx,%edi
call   1040 <isalpha@plt>
test   %rax,%rax
je     1140 <get_key+0x10>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <toupper@plt>

LLVM IR (-O0):
define signext i8 @get_key() {
%1 = alloca i8
br label %2
2: ; preds = %0, %10
%3 = call signext i8 (...) @getc()
store i8 %3, i8* %1
%4 = load i8, i8* %1
%5 = call i64 @isalpha(i8 signext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8, i8* %1
%9 = call signext i8 @toupper(i8 signext %8)
ret i8 %9
10: ; preds = %2
br label %2
}

LLVM IR (-O2):
define signext i8 @get_key() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getc()
%3 = tail call i64 @isalpha(i8 signext %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = tail call signext i8 @toupper(i8 signext %2)
ret i8 %6
}
void RTStrPrintfEx(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrPrintfEx() {
ret void
}
/* Variables and functions */
double DBL_MIN;
double tinydbl_(double *x) { return DBL_MIN; }


x86 assembly (clang, -O0):
<tinydbl_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed1(%rip),%rax
movsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<tinydbl_>:
mov    0x2ed9(%rip),%rax
movsd  (%rax),%xmm0
ret

LLVM IR (-O0):
@DBL_MIN = global double 0.000000e+00
define double @tinydbl_(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double, double* @DBL_MIN
ret double %3
}

LLVM IR (-O2):
@DBL_MIN = global double 0.000000e+00
define double @tinydbl_(double* nocapture readnone %0) {
%2 = load double, double* @DBL_MIN
ret double %2
}
void gtk_action_group_add_toggle_actions_full() {}


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

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

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

LLVM IR (-O2):
define void @gtk_action_group_add_toggle_actions_full() {
ret void
}
/* Variables and functions */
int chdir(char const *);
int octave_chdir_wrapper(const char *nm) { return chdir(nm); }


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

x86 assembly (clang, -O2):
<octave_chdir_wrapper>:
jmp    1030 <chdir@plt>

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

LLVM IR (-O2):
define i32 @octave_chdir_wrapper(i8* %0) {
%2 = tail call i32 @chdir(i8* %0)
ret i32 %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t cf_b64_encoded_len(uint32_t in_size) {
  return ((in_size + 2) / 3) << 2;
}


x86 assembly (clang, -O0):
<cf_b64_encoded_len>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
shl    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cf_b64_encoded_len>:
add    $0x2,%edi
movslq %edi,%rax
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
shl    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @cf_b64_encoded_len(i32 %0) {
%2 = add nsw i32 %0, 2
%3 = sdiv i32 %2, 3
%4 = shl i32 %3, 2
ret i32 %4
}
int mule_strerror_r() { return -1; }


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

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

LLVM IR (-O0):
define i32 @mule_strerror_r() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @mule_strerror_r() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void blob_free(void *addr, unsigned long size) { free(addr); }


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

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

LLVM IR (-O0):
define void @blob_free(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 = call i32 @free(i8* %5)
ret void
}

LLVM IR (-O2):
define void @blob_free(i8* nocapture %0, i64 %1) {
%3 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void __attribute__((noreturn)) gc_stack_collector_no_varlambda() { assert(0); }


x86 assembly (clang, -O0):
<gc_stack_collector_no_varlambda>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <assert@plt>

x86 assembly (clang, -O2):
<gc_stack_collector_no_varlambda>:
push   %rax
xor    %edi,%edi
call   1030 <assert@plt>

LLVM IR (-O0):
define void @gc_stack_collector_no_varlambda() {
%1 = call i32 @assert(i32 0)
unreachable
}

LLVM IR (-O2):
define void @gc_stack_collector_no_varlambda() {
%1 = tail call i32 @assert(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int Error() {
  fprintf(stderr, "ldmc [-o OutputFileName] LDMFileName\n");
  exit(0);
}


x86 assembly (clang, -O0):
<Error>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [38 x i8] c"ldmc [-o OutputFileName] LDMFileName\0A\00"
define i32 @Error() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [38 x i8] c"ldmc [-o OutputFileName] LDMFileName\0A\00"
define i32 @Error() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
void I420ToRGB24() {}


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

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

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

LLVM IR (-O2):
define void @I420ToRGB24() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ g(int);
int main() {
  g(0x1234567887654321ll);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x87654321,%edi
call   1030 <g@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @g(i32 -2023406815)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @g(i32 -2023406815)
ret i32 0
}
int nn_xpub_events(__attribute__((unused)) struct nn_sockbase *self) {
  return 2;
}


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

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

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

LLVM IR (-O2):
%struct.nn_sockbase = type opaque
define i32 @nn_xpub_events(%struct.nn_sockbase* nocapture readnone %0) {
ret i32 2
}
/* Type definitions */
struct data_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ data_node_print_(struct data_node *, int);
int /*<<< orphan*/ printf(char *);
void data_node_print(struct data_node *self) {
  printf("{\n");
  data_node_print_(self, 1);
  printf("}\n");
}


x86 assembly (clang, -O0):
<data_node_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <data_node_print_@plt>
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<data_node_print>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <data_node_print_@plt>
lea    0xebe(%rip),%rdi
pop    %rbx
jmp    1040 <puts@plt>

LLVM IR (-O0):
%struct.data_node = type { i32 }
@.str = [3 x i8] c"{\0A\00"
@.str.1 = [3 x i8] c"}\0A\00"
define void @data_node_print(%struct.data_node* %0) {
%2 = alloca %struct.data_node*
store %struct.data_node* %0, %struct.data_node** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = load %struct.data_node*, %struct.data_node** %2
%5 = call i32 @data_node_print_(%struct.data_node* %4, i32 1)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.data_node = type { i32 }
@str = [2 x i8] c"{\00"
@str.2 = [2 x i8] c"}\00"
define void @data_node_print(%struct.data_node* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @data_node_print_(%struct.data_node* %0, i32 1)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.2, i64 0, i64 0))
ret void
}
char compatibleVertexLabels(int l1, int l2) { return (l1 == l2); }


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

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

LLVM IR (-O0):
define signext i8 @compatibleVertexLabels(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
%9 = trunc i32 %8 to i8
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @compatibleVertexLabels(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = zext i1 %3 to i8
ret i8 %4
}
/* Type definitions */
typedef scalar_t__ memcmp;

/* Variables and functions */
size_t strclen(char const *, int);
char *(strcstarts)(const char *string, const char *desired, int stop) {
  size_t n = strclen(string, stop);
  size_t m = strclen(desired, stop);
  if (n < m)
    return NULL;
  return (memcmp)(string, desired, m) ? NULL : string;
}


x86 assembly (clang, -O0):
<strcstarts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <strclen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <strclen@plt>
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x30(%rbp),%rax
jae    115e <strcstarts+0x4e>
movq   $0x0,-0x8(%rbp)
jmp    1184 <strcstarts+0x74>
cmpq   $0x0,-0x30(%rbp)
je     1174 <strcstarts+0x64>
xor    %eax,%eax
mov    %rax,-0x38(%rbp)
jmp    117c <strcstarts+0x6c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcstarts>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %edx,%esi
call   1030 <strclen@plt>
mov    %rax,%r15
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <strclen@plt>
xor    %ecx,%ecx
test   %rax,%rax
cmovne %rcx,%rbx
cmp    %rax,%r15
cmovb  %rcx,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @strcstarts(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i64
%9 = alloca i64
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%10 = load i8*, i8** %5
%11 = load i32, i32* %7
%12 = call i64 @strclen(i8* %10, i32 %11)
store i64 %12, i64* %8
%13 = load i8*, i8** %6
%14 = load i32, i32* %7
%15 = call i64 @strclen(i8* %13, i32 %14)
store i64 %15, i64* %9
%16 = load i64, i64* %8
%17 = load i64, i64* %9
%18 = icmp ult i64 %16, %17
br i1 %18, label %19, label %20
19: ; preds = %3
store i8* null, i8** %4
br label %30
20: ; preds = %3
%21 = load i8*, i8** %5
%22 = load i8*, i8** %6
%23 = load i64, i64* %9
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %20
br label %28
26: ; preds = %20
%27 = load i8*, i8** %5
br label %28
28: ; preds = %26, %25
%29 = phi i8* [ null, %25 ], [ %27, %26 ]
store i8* %29, i8** %4
br label %30
30: ; preds = %28, %19
%31 = load i8*, i8** %4
ret i8* %31
}

LLVM IR (-O2):
define i8* @strcstarts(i8* %0, i8* %1, i32 %2) {
%4 = tail call i64 @strclen(i8* %0, i32 %2)
%5 = tail call i64 @strclen(i8* %1, i32 %2)
%6 = icmp ult i64 %4, %5
%7 = icmp eq i64 %5, 0
%8 = select i1 %7, i8* %0, i8* null
%9 = select i1 %6, i8* null, i8* %8
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ BottomUpSort(int *, int *, int);
int /*<<< orphan*/ print(int *, int);
int main() {
  int A[100];
  int B[100];
  A[0] = 1;
  A[1] = 8;
  A[2] = 4;
  A[3] = 5;
  int n = 4;
  print(A, n);
  BottomUpSort(A, B, n);
  print(A, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x340,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x1a0(%rbp)
movl   $0x8,-0x19c(%rbp)
movl   $0x4,-0x198(%rbp)
movl   $0x5,-0x194(%rbp)
movl   $0x4,-0x334(%rbp)
lea    -0x1a0(%rbp),%rdi
mov    -0x334(%rbp),%esi
call   1040 <print@plt>
lea    -0x1a0(%rbp),%rdi
lea    -0x330(%rbp),%rsi
mov    -0x334(%rbp),%edx
call   1030 <BottomUpSort@plt>
lea    -0x1a0(%rbp),%rdi
mov    -0x334(%rbp),%esi
call   1040 <print@plt>
xor    %eax,%eax
add    $0x340,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x320,%rsp
movaps 0xed1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
call   1040 <print@plt>
lea    0x190(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1030 <BottomUpSort@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1040 <print@plt>
xor    %eax,%eax
add    $0x320,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i32]
%3 = alloca [100 x i32]
%4 = alloca i32
store i32 0, i32* %1
%5 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 0
store i32 1, i32* %5
%6 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 1
store i32 8, i32* %6
%7 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 2
store i32 4, i32* %7
%8 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 3
store i32 5, i32* %8
store i32 4, i32* %4
%9 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 0
%10 = load i32, i32* %4
%11 = call i32 @print(i32* %9, i32 %10)
%12 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 0
%13 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 0
%14 = load i32, i32* %4
%15 = call i32 @BottomUpSort(i32* %12, i32* %13, i32 %14)
%16 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 0
%17 = load i32, i32* %4
%18 = call i32 @print(i32* %16, i32 %17)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [100 x i32]
%2 = alloca [100 x i32]
%3 = bitcast [100 x i32]* %1 to i8*
%4 = bitcast [100 x i32]* %2 to i8*
%5 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 0
%6 = bitcast [100 x i32]* %1 to <4 x i32>*
store <4 x i32> <i32 1, i32 8, i32 4, i32 5>, <4 x i32>* %6
%7 = call i32 @print(i32* %5, i32 4)
%8 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 0
%9 = call i32 @BottomUpSort(i32* %5, i32* %8, i32 4)
%10 = call i32 @print(i32* %5, i32 4)
ret i32 0
}
void wifi_rsp_config_get_mac(const struct wifi_msg_config_get_mac_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.wifi_msg_config_get_mac_rsp_t = type opaque
define void @wifi_rsp_config_get_mac(%struct.wifi_msg_config_get_mac_rsp_t* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ arp_probe(void *);
void ipv4ll_probe(void *arg) { arp_probe(arg); }


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

x86 assembly (clang, -O2):
<ipv4ll_probe>:
jmp    1030 <arp_probe@plt>

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

LLVM IR (-O2):
define void @ipv4ll_probe(i8* %0) {
%2 = tail call i32 @arp_probe(i8* %0)
ret void
}
/* Type definitions */
struct tms {
  int /*<<< orphan*/ tms_utime;
};
typedef int /*<<< orphan*/ clock_t;

/* Variables and functions */
int /*<<< orphan*/ _times(struct tms *);
clock_t clock(void) {
  struct tms tms;
  _times(&tms);
  return tms.tms_utime;
}


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

x86 assembly (clang, -O2):
<clock>:
push   %rax
mov    %rsp,%rdi
call   1030 <_times@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tms = type { i32 }
define i32 @clock() {
%1 = alloca %struct.tms
%2 = call i32 @_times(%struct.tms* %1)
%3 = getelementptr inbounds %struct.tms, %struct.tms* %1, i32 0, i32 0
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
%struct.tms = type { i32 }
define i32 @clock() {
%1 = alloca %struct.tms
%2 = bitcast %struct.tms* %1 to i8*
%3 = call i32 @_times(%struct.tms* %1)
%4 = getelementptr inbounds %struct.tms, %struct.tms* %1, i64 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
__attribute__((always_)) uint32_t __STREXH(uint16_t value,
                                           volatile uint16_t *addr) {
  uint32_t result;
  return (result);
}


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

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

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

LLVM IR (-O2):
define i32 @__STREXH(i32 %0, i32* nocapture readnone %1) {
ret i32 undef
}
/* Variables and functions */
int GET_NUM_ELEMS_ARR(int *);
float average(int *, int);
int /*<<< orphan*/ printf(char *, float);
int main(void) {
  int a[] = {1, 2, 3, 4, 5, 6, 7};
  float result;
  int size = GET_NUM_ELEMS_ARR(a);
  result = average(a, size);
  printf("el promedio de las muestras es:%f\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xeb2(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
call   1050 <GET_NUM_ELEMS_ARR@plt>
mov    %eax,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%esi
call   1040 <average@plt>
movss  %xmm0,-0x24(%rbp)
movss  -0x24(%rbp),%xmm0
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movups 0xed0(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <GET_NUM_ELEMS_ARR@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <average@plt>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a = [7 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7]
@.str = [35 x i8] c"el promedio de las muestras es:%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i32]
%3 = alloca float
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [7 x i32]* %2 to i8*
%6 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
%7 = call i32 @GET_NUM_ELEMS_ARR(i32* %6)
store i32 %7, i32* %4
%8 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
%9 = load i32, i32* %4
%10 = call float @average(i32* %8, i32 %9)
store float %10, float* %3
%11 = load float, float* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), float %11)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [7 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7]
@.str = [35 x i8] c"el promedio de las muestras es:%f\0A\00"
define i32 @main() {
%1 = alloca [7 x i32]
%2 = bitcast [7 x i32]* %1 to i8*
%3 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%4 = call i32 @GET_NUM_ELEMS_ARR(i32* %3)
%5 = call float @average(i32* %3, i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), float %5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ output_chars(int /*<<< orphan*/ *,
                                int /*<<< orphan*/ const *const, int const,
                                int);
void output_spaces(const int n, const uint32_t *const attr) {
  output_chars(NULL, attr, n, false);
}


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

x86 assembly (clang, -O2):
<output_spaces>:
mov    %edi,%edx
xor    %edi,%edi
xor    %ecx,%ecx
jmp    1030 <output_chars@plt>

LLVM IR (-O0):
define void @output_spaces(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i32, i32* %3
%7 = call i32 @output_chars(i32* null, i32* %5, i32 %6, i32 0)
ret void
}

LLVM IR (-O2):
define void @output_spaces(i32 %0, i32* %1) {
%3 = tail call i32 @output_chars(i32* null, i32* %1, i32 %0, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ *allocate_buffer(scalar_t__);
int /*<<< orphan*/ strcpy(int /*<<< orphan*/ *, char *);
scalar_t__ strlen(char *);
uint8_t *copy_text_to_buffer(char *text) {
  uint8_t *buffer = allocate_buffer(strlen(text) + 1);
  if (buffer) {
    strcpy(buffer, text);
  }
  return buffer;
}


x86 assembly (clang, -O0):
<copy_text_to_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <allocate_buffer@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116d <copy_text_to_buffer+0x3d>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_text_to_buffer>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <allocate_buffer@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <copy_text_to_buffer+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32* @copy_text_to_buffer(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i32* @allocate_buffer(i64 %3)
%5 = icmp eq i32* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @strcpy(i32* %4, i8* %0)
br label %8
8: ; preds = %6, %1
ret i32* %4
}
void testfunc_01(volatile const char *ap, volatile char *bp) {
  bp[100] = ap[15];
  bp[200] = ap[50];
  bp[900] = ap[71];
  bp[0] = ap[25];
}


x86 assembly (clang, -O0):
<testfunc_01>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0xf(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x64(%rax)
mov    -0x8(%rbp),%rax
mov    0x32(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0xc8(%rax)
mov    -0x8(%rbp),%rax
mov    0x47(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x384(%rax)
mov    -0x8(%rbp),%rax
mov    0x19(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<testfunc_01>:
mov    0xf(%rdi),%al
mov    %al,0x64(%rsi)
mov    0x32(%rdi),%al
mov    %al,0xc8(%rsi)
mov    0x47(%rdi),%al
mov    %al,0x384(%rsi)
mov    0x19(%rdi),%al
mov    %al,(%rsi)
ret

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

LLVM IR (-O2):
define void @testfunc_01(i8* %0, i8* %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 15
%4 = load volatile i8, i8* %3
%5 = getelementptr inbounds i8, i8* %1, i64 100
store volatile i8 %4, i8* %5
%6 = getelementptr inbounds i8, i8* %0, i64 50
%7 = load volatile i8, i8* %6
%8 = getelementptr inbounds i8, i8* %1, i64 200
store volatile i8 %7, i8* %8
%9 = getelementptr inbounds i8, i8* %0, i64 71
%10 = load volatile i8, i8* %9
%11 = getelementptr inbounds i8, i8* %1, i64 900
store volatile i8 %10, i8* %11
%12 = getelementptr inbounds i8, i8* %0, i64 25
%13 = load volatile i8, i8* %12
store volatile i8 %13, i8* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ execve(char *, char **, int /*<<< orphan*/ *);
int main() {
  char *args[2];
  args[0] = "/bin/sh";
  args[1] = NULL;
  execve(args[0], args, NULL);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <execve@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xee5(%rip),%rdi
mov    %rdi,(%rsp)
movq   $0x0,0x8(%rsp)
mov    %rsp,%rsi
xor    %edx,%edx
call   1030 <execve@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"/bin/sh\00"
define i32 @main() {
%1 = alloca [2 x i8*]
%2 = bitcast [2 x i8*]* %1 to i8*
%3 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 1
store i8* null, i8** %4
%5 = call i32 @execve(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %3, i32* null)
ret i32 0
}
void __mwait(unsigned long eax, unsigned long ecx) {
  asm volatile(".byte 0x0f, 0x01, 0xc9;" ::"a"(eax), "c"(ecx));
}


x86 assembly (clang, -O0):
<__mwait>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mwait  %eax,%ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<__mwait>:
mov    %rsi,%rcx
mov    %rdi,%rax
mwait  %eax,%ecx
ret

LLVM IR (-O0):
define void @__mwait(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
ret void
}

LLVM IR (-O2):
define void @__mwait(i64 %0, i64 %1) {
tail call void asm sideeffect ".byte 0x0f, 0x01, 0xc9;", "{ax},{cx},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1)
ret void
}